TCP/IP Addressing - Computer Technology Training

advertisement
Unit 3:
TCP/IP Protocol
Section 1: IP Addressing and Ports
In this section you will learn about configuring TCP/IP addresses and
subnet masks.
At the end of this section you should be able to:
1. Identify IP address formats and classes
2. Describe the use of subnet masks in IPv4 Addressing and be
able to configure IP subnetting on a device
3. Describe how DHCP is used in configuring devices on IPv4
networks. Be able to configure a device using either
manual, automatic (DHCP) settings.
4. Describe IPv6 Addressing
5. Describe and identify Port numbers
Objective 1: Identify IP Address Formats and Classes
The TCP/IP system was originally developed in the 1960 by the Department of Defense for use it its
ARPANET (precursor to the Internet) and consists of several protocols that operate at the Network,
Transport, and Application layers of the OSI model. One of the key components of this protocol suite is
the Network layer IP protocol that is responsible for routing datagram packets between devices
dispersed across many separately managed network environments. While a MAC address can identify a
specific computer, it has no way of organizing these devices into logical networks. In order to route
packets between networks, the IP protocol needs an addressing system that includes both a network id
and computer id. The original IP addressing system, currently called IPv4, consists of 32 bits that are
divided into 4 octets (each octet is a byte) using a system called dotted-decimal notation:
Each address contains a logical network id and a logical host id. The IPv4 addresses can be divided into
address classes based on the value of the first number as shown below:
Class A: Value of first number between 1 and 126
Up to 126 network addresses with over 16 million hosts or devices per network.
Class B: Value of first number between 128 and 191
Divides the address into two equal parts with the first two octets being network and the last two
octets being the logical address of the host or device. You can have up approximately 16300
Class B network addresses with 65535 devices per network.
Class C: Value of first number between 192 and 223
The first three octets are the network and the last octet is the logical device address. You can
have over 2 million Class C addresses with up to 255 hosts or devices per Class C network.
Class D: Value of first number between 224 and 239
This address range is used for multi-cast groups. In a multicast group, a packet is received by all
all devices in the group. Eliminating the need to send a packet out multiple times, one copy to
each device. Used to stream data or audio/video to a number of devices simultaneously.
The network range from 240-254 is intended for experimental use.
Reserved IP Addresses
Within the IP address set there are certain reserved IP addresses. A network or host address of all “1”s
indicates a broadcast sent to all devices on the subnet. A network or host address of all zeros is also
reserved. This means that a network address or a host address can never be all “0s” or all “1s”. When
planning network address range you need to eliminate these addresses. For example, if you are using a
class C address of 192.168.1, the range of device addresses would be 254 devices 000000001 through
11111110 (1 – 254).
The address “127.whatever” is reserved for loopback addresses. This means that whenever the IP
protocol (which runs at the network layer) sees an packet going an address that starts with 127, it simply
sends the packet back up its own protocol stack. Loopback addresses are used to test applications and
TCP configurations. For example, if you recently installed new Web server software on your computer,
from the console of your computer you could open a Web browser and enter the URL “http://127.0.0.1”
to see if the Web server application is responding. Any address in the 127 range is considered a
loopback address, so you could also enter “http://127.10.10.100” or whatever, and get the same results.
The designers of IPv4 also reserved a set of addresses within each class as Private IP addresses. Private
IP addresses are not routable across BGP based Internet routers, but instead are intended to be used
only with a private LAN and MAN networks. Following is a list of Private IP address for each address
class:
Whenever you are configuring a private network, which is most the time, you should use one of these
address ranges for your internal routers and subnets.
Objective 2: Describe the use of subnet masks in IPv4 Addressing
In addition to an IP address, each device is also assigned a Subnet Mask. The bits in the subnet mask are
also used to identify which part of the IP address is network and which part is the logical host or device.
Notice that each address class has a default Subnet Mask. The number 255 in each octet indicates that
all bits are turned on, telling the device that these bits are reserved for the network address. A “0” in the
subnet mask tells the device that the bit in the associated position is part of the logical device address.
The Subnet Mask is used to break large class A and B networks into smaller subnets as shown below:
In the previous figure, the class B address (132.201) is being divided internally into 3 subnets. The
outside world will see all computers as one Class B network, but when the packet arrives at the internal
router, it will be sent to the appropriate switch based on the value of the 3rd octet. The subnet mask
used on the internal router for this network would be (255.255.255.0). Using this mask, there could be
up to 254 subnets (132.201.1 – 132.201.254), with each subnet having up to 254 devices.
There are two ways to determine subnets and associated network addresses in IPv4. The original
method is called classful and uses subnet masks specified using the 255.255.0.0 format. While this
format works well with simple subnetting, it is difficult to work with when less that a complete byte (8
bits) is being assigned to a subnet address.
The more modern system is called CIDR (Classless Interdomain Routing). CIDR specifies the number of
bits in the network address as a number separated from the IP address by a “/”. For example, the
default mask for a Class A network would be written as 10.0.0.100/8. The IP address for the first
computer in subnet “1” shown in the previous figure would be 132.201.2.1/24. Following is a list of
default CIDR addresses for the network classes:
Class A: /8 Example: 10.1.1.2/8
Class B: /16 –
Example: 172.20.10.1/16
Class C: /24 Example: 192.168.1.5/24
Whenever an existing network address is broken into additional (smaller) sub-networks, the result is
called sub-netting. In sub-netting, the number of network mask bits is always more than the default
network bits for that class. The subnets shown previously using network address 132.201 is an example
of sub-netting since the mask bits were increased from the default of 255.255.0.0 to 255.255.255.0 used
in the subnet mask. In this example the default class B network for address 132.201 using CIDR would be
expressed as /16, but since the mask is set to /24, it is called sub-netting. In sub-netting, you create
extra networks with fewer computers on each network.
In some cases subnets can be a fraction of a byte. For example, assume you want to take a class C
address of 192.168.1.x and create separate subnets for each of three departments in your organization.
You will need a minimum of 3 bits to create three subnets. This would create up to 6 possible subnets;
001, 010, 011, 100, 101, and 110 (000 and 111 are reserved). The last 5 bits of the fourth octet would be
the device address and could range from 00001 to 11110 (1 – 30). The first computer on subnet 001,
would have the address of 192.166.1.33 (00100001). This looks kind of weird because the first computer
appears to be number 33, but remember, the 32 is coming from the sub-net number.
In certain cases you may need more devices than the default subnet mask allows. For example, say you
have 300 devices that must go on the same set of switches and share the network address of 192.168.4.
Since this is a class C network, using classful addresses you could have a maximum of 254 devices.
However, if we were to move the default mask one-bit to the left, from 192.168.4.x/24 (255.255.255.0),
the default expressed in CIDR, to 192.168.4.x/23 (255.255.254.0), we could effectively double the
number of devices on the Class C network. This process of increasing the number of devices above the
number specified by the class’s default mask is called Supernetting. Using traditional subnet masks, the
subnets could be created using the subnet mask 255.255.254.0.
Without super-netting, the maximum device address with a this Class C network would be
192.168.4.254 (00000100.11111110), using the super-net mask we get an extra bit, making the
maximum device address 192.168.5.254 (192.168.00000101.11111110 ).
Today super-netting is happening more frequently due to the Bing Your Own Device (BYOD) principle
since employees or customers are bringing their own tablets and smart phones to the office or store
taking up IP addresses.
The book covers using complex sub-net and CIDR super-net masks on pages 491 – 496. We will discuss
these concepts more in our live presentation.
Planning IP Addresses
In order to communicate with other computers on a LAN and access the Internet, at a minimum a device
needs to have an IP address, a Subnet Mask, and a default gateway. The gateway is the router that
attaches the subnet to other LANs or to the Internet.
It is necessary for all devices on the same subnet, including the gateway device, to share a common
network address and mask. For example, assume the above network is using IP address 192.168.1.x with
a mask of 255.255.255.0. The computers would be numbered 192.168.1.1, 192.168.1.2, and 192.168.
1.3. The Gateway would have two IP addresses. The IP address attached to the switch might be
192.168.1.10, and the IP address to the Internet might be some public address such as 132.20.100.15.
When a computer sends a packet to another device it uses its Mask to check the network address of the
destination against its own network address. If the network addresses are the same, the device will send
an ARP broadcast to the switch to get the MAC address of the receiving device. It will then place the
MAC address of the receiving device on the data frame and send the packet directly to the receiver. If
the network address of the receiver is different from the computer’s own network address, it will send
an ARP broadcast to get the MAC address of the default gateway it has been configured to use. It will
then send the packet to the default gateway device which will route the packet to the destination
network or out to the Internet.
When troubleshooting network problems, first check to be sure all the computers or devices on a subnet
have the same subnet mask. Next check the IP address to ensure the network address is correct for each
device. Finally, be sure each device has the correct default gateway configured. The default gateway
must be on the same subnet as the device.
Objective 3: Assigning IP Addresses
IP address information can either be entered manually as static information, or be dynamically assigned
through an automated process. Client computers generally get their IP address information assigned
automatically where as servers and other fixed devices such as network printers and gateway devices
are manually assigned a static address so it will not change unexpectedly.
Manual IP address Assignment
Each device or operating system has its own way of manually configuring the IP address information.
When working with Windows 7, you can follow the steps shown below to check or change the IP
configuration:
1. Open Control Panel and click View network status and tasks link under Network and Internet
heading.
2. Click Change adapter settings link
3. Right-click your network connection and click Properties. If necessary click Yes to allow changes.
4. Click the Internet Protocol Version 4 option and then click Properties to display the information
shown below.
5. Notice that in this example the system have been given a static IP address. Notice that the
Default Gateway is on the same network as the computer which uses the default class C mask of
255.255.255.0.
6. You can click the Obtain an IP address automatically to use automatic IP address configuration.
7. Close all windows.
Automatic IP address Assignment
The book describes the following 3 methods of automatic IP address assignment on pages 152 –
156. Following is a summary of the information presented.
BOOTP (Bootstrap Protocol)
Older system used in 1980s to assign IP address based on client MAC address.
Can traverse routers
Requires manual entries of IP and MAC addresses
Still used with diskless workstations to boot from a network.
DHCP (Dynamic Host Configuration Protocol)
Requires a DHCP service running on a server computer.
Administrator must Configure IP address ranges on server.
Clients are assigned an IP address from the range.
Each time the client may receive a different IP address
Leases IP address information to client. Includes:
IP Address, Mask, Default Gateway, DNS server
Like BootP, Addresses can be pre-assigned based on MAC address.
Useful in configuring devices such as Printer which need a fixed IP address
Client must periodically renew IP address lease.
DHCP process:
Client broadcast request for DHCP server
DCHP server responds with a offer.
Client takes offer from first DCHP server
DHCP server acknowledges and address is leased to the client
Leases can be terminated by Client or DHCP server.
APIPA (Automatic Private IP Addressing)
Used by Windows if no DHCP service is available.
Assigns Class B reserved address in range 169.254.x.y
Usually a sign that the computer is not connected to network or cannot communicate
with the DHCP service.
Objective 4: Describe IPv6 Addressing
When TCP/IP was originally designed back in the 1960s, no one foresaw the advent of personal
computers or the Internet. It is amazing how well TCP/IP has been able to adapt to the exponential
growth of users and applications on the Internet. At the time TCP/IP was designed, the 32-bit IP
addressing scheme provided far more addresses than anyone imagined would be needed. Today, we are
nearing the end of available IP addresses and desperately need an updated addressing system that can
handle a larger and more specialized Internet usage. Enter IPv6 .. also called IPng (next generation).
IPv6 offers several advantages over IPv4:
o More efficient heading information
o Improved security
o Improved prioritization
IPv6 addresses:
Composed of 8 16-bit fields (128-bits)
Each 16-bit field represented by 4 Hex digits separated by colons.
F:F:0:0:0:0:3012:0CE3 same as 000F:000F:0000:0000:0000:0000:3012:0CE3
A string of “0000” fields may be represented by a double ::
F:F::3012:CE3 ( in shorthand)
Because there are 8 16 bit fields, it is assumed 4 fields of 0000 between the “::”
Loopback address = ::1 (0000:0000:0000:0000:0000:0000:0000:0001)
Address reflects scope of transmission’s recipients:
Unicast address:
Starts with – FEC
Anycast address (represents any one interface rom a group of interfaces):
Starts with – FE
Multicast address:
Starts with – FF0x
“x” is the group id
Global multicast:
Starts with – FF0E
Objective 4: Describe and Identify Port Numbers
Port numbers are used by the Transport layer to direct packets between client and service applications.
Each client or server application that works with TCP/IP must be assigned a port number. Typically
services register have pre-defined port numbers that are assigned during installation. Client requests are
given port numbers when they send out requests to services. When a packet is received by the
Transport layer at a server, the port number is used to determine which application service will process
the data. When a client issues a request to a service, it places the port number of the service in its
request packet. The Transport layer will then assign a port number that will be used to receive the data
returned by the network service. When the service application processes the request, it returns its
results using the port number from the client request. Using the client’s port number allows the
receiving machine to return the data to the correct client application. For example, you may have two
different Web browsers running on your computer, each one is given a different port number. Both
applications may request information from the same Web site. The results for each request are returned
to the appropriate Web browser through the use of Port numbers. The table on page 159 lists common
port numbers you should know for Network + certification:
Network+ Guide to Networks, 5th Edition
Chapter 4: Selected Review Questions
4. For which of the following nodes would it make the most sense to assign a static, rather than
dynamic, IP address?
Pages 151-152
7. Suppose you have a workstation that uses the IP address 203.12.176.55 on a traditional IPv4
network. To what network class does the workstation belong?
Page 148
8. How many bytes are used for an IPv4 IP address?
Page 147
9. Suppose your computer’s IP address is 155.61.9.188, and your network administrator has not
subnetted the network to which you’re connected. What is your computer’s subnet mask?
Page 151
10. Suppose you send data to the 11111111 11111111 11111111 11111111 IP address on an IPv4
network. To what device(s) are you transmitting?
Page 147
11. Suppose you send data to an address that begins with the Format Prefix FF0E on a network
running IPv6. To what device(s) are you transmitting?
Page 157
12. What is the main difference between BOOTP and DHCP?
Page 152
13. If you are connected to a network that uses DHCP, and you need to terminate your Windows
Vista workstation’s DHCP lease, which of the following commands would you use?
Page 155
16. On a client/server network, what computer initiates the process of assigning an IP address
through DHCP?
Page 153
17. You issue a transmission from your workstation to the following socket address on your
LAN: 10.1.1.145:110. Assuming your network uses standard port designations, what Application
layer protocol are you using?
Page 159
18. You are the network manager for a computer training center that allows clients to bring their
own laptops to class for learning and taking notes. Clients need access to the Internet, so you
have configured your network’s DHCP server to issue them IP addresses automatically. What
DHCP option should you modify to make sure you are not wasting addresses that were used by
clients who have completed a class and no longer need them?
Page 153
19. You manage a server that allows university students to use Telnet to make a connection, then
use FTP to upload their homework. Professors also pick up students’ homework by telnetting to
the computer and using FTP. You have decided to change the FTP port number on the server
from its default number to 23, for better security. Assuming students and professors make no
changes to their default workstation configurations, what will be the result of this change?
Page 159
21. If you want to determine only whether the TCP/IP protocols are installed and functioning
properly on your workstation, you could:
Page 172
22. In class, you glance at your neighbor’s computer and notice that she has typed the following
IP address in her browser’s URL text box: 127.0.0.1:80. What is she most likely attempting to
do?
Page 149
24. Which of the following represents the loopback address in IPv6?
Page 157
Chapter 10: Selected Review Questions
1. Convert the following subnet mask into its dotted-decimal equivalent: 11111111
11111111 11111000 00000000.
Page 489
2. What is the default subnet mask for a Class A network?
Page 489
3. A node on a network has an IP address of 140.133.28.72 and its subnet mask is
255.248.0.0. What type of subnetting has been used on this network?
Page 495
Class B – default mask is 255.255.0.0 /16
Actual mask is 255.248.0.0 /13
When the actual mask contains less bits than the default mask then we have supernet
because there can be more computers in the network segment.
4. On a network with an IP address of 140.133.28.72 (or 10001100 10000101 00011100
01001000) and a subnet mask of 255.248.0.0 (or 11111111 11111000 00000000
00000000), what is the network ID?
5. As a networking consultant, you've been asked to help expand a client's TCP/IP
network. The network administrator tells you that the network ID is subnetted as
185.27.54.0/26. On this network, how many bits of each IP address are devoted to host
information?
Page 495
6. If you worked on an older network that could not interpret classless addressing, and
your network ID was 145.27.0.0, what is the theoretical maximum number of different
subnets you could create on this network?
Page 4907. You have decided to create 254 subnets on your Class B network. What subnet mask
will you use to accomplish this?
Page 490-
8. If you subdivide your Class B network into 254 subnets, what is the maximum number
of hosts you can assign to any single subnet?
Page 4909. Your company has leased a Class C network whose network ID is 205.61.128.0. You
want to create 16 subnets within this network. One of the subnets will have an extended
network prefix of 205.61.128.64. What will be the broadcast address for this subnet?
(Hint: If you know the number of hosts per subnet, you can easily determine the
broadcast address.)
Page 49010. Your workstation's IP address is 10.35.88.12, and your supervisor's workstation's IP
address is 10.35.91.4. When you send data from your workstation to your supervisor's
workstation, what is the most likely IP address of the first default gateway that will accept
and interpret your transmission?
Page 496
Download