Tuesday, March 23, 2010

Introduction to the TCP/IP transport layer

Introduction to the TCP/IP transport layer
11.1.1 This page will describe the functions of the transport layer.


The primary duties of the transport layer are to transport and regulate the flow of information from a source to a destination, reliably and accurately. End-to-end control and reliability are provided by sliding windows, sequencing numbers, and acknowledgments.

To understand reliability and flow control, think of someone who studies a foreign language for one year and then visits the country where that language is used. In conversation, words must be repeated for reliability. People must also speak slowly so that the conversation is understood, which relates to flow control.

The transport layer establishes a logical connection between two endpoints of a network. Protocols in the transport layer segment and reassemble data sent by upper-layer applications into the same transport layer data stream. This transport layer data stream provides end-to-end transport services.

The two primary duties of the transport layer are to provide flow control and reliability. The transport layer defines end-to-end connectivity between host applications. Some basic transport services are as follows:

• Segmentation of upper-layer application data

• Establishment of end-to-end operations

• Transportation of segments from one end host to another

• Flow control provided by sliding windows

• Reliability provided by sequence numbers and acknowledgments

TCP/IP is a combination of two individual protocols. IP operates at Layer 3 of the OSI model and is a connectionless protocol that provides best-effort delivery across a network. TCP operates at the transport layer and is a connection-oriented service that provides flow control and reliability. When these protocols are combined they provide a wider range of services. The combined protocols are the basis for the TCP/IP protocol suite. The Internet is built upon this TCP/IP protocol suite.

The next page will explain how the transport layer controls the flow of data.

Module 11: TCP/IP Transport and Application Layers

Overview
The TCP/IP transport layer transports data between applications on source and destination devices. Familiarity with the transport layer is essential to understand modern data networks. This module will describe the functions and services of this layer.


Many of the network applications that are found at the TCP/IP application layer are familiar to most network users. HTTP, FTP, and SMTP are acronyms that are commonly seen by users of Web browsers and e-mail clients. This module also describes the function of these and other applications from the TCP/IP networking model. This module covers some of the objectives for the CCNA 640-801, INTRO 640-821, and ICND 640-811 exams.

Students who complete this module should be able to perform the following tasks:

• Describe the functions of the TCP/IP transport layer
• Describe flow control
• Explain how a connection is established between peer systems
• Describe windowing
• Describe acknowledgment
• Identify and describe transport layer protocols
• Describe TCP and UDP header formats
• Describe TCP and UDP port numbers
• List the major protocols of the TCP/IP application layer
• Provide a brief description of the features and operation of well-known TCP/IP applications

Summary of Module 10

Summary
This page summarizes the topics discussed in this module.


IP is referred to as a connectionless protocol because no dedicated circuit connection is established between source and destination prior to transmission, IP is referred to as unreliable because does not verify that the data reached its destination. If verification of delivery is required then a combination of IP and a connection-oriented transport protocol such as TCP is required. If verification of error-free delivery is not required IP can be used in combination with a connectionless transport protocol such as UDP. Connectionless network processes are often referred to as packet switched processes. Connection-oriented network processes are often referred to as circuit switched processes.

Protocols at each layer of the OSI model add control information to the data as it moves through the network. Because this information is added at the beginning and end of the data, this process is referred to as encapsulating the data. Layer 3 adds network, or logical, address information to the data and Layer 2 adds local, or physical, address information.

Layer 3 routing and Layer 2 switching are used to direct and deliver data throughout the network. Initially, the router receives a Layer 2 frame with a Layer 3 packet encapsulated within it. The router must strip off the Layer 2 frame and examine the Layer 3 packet. If the packet is destined for local delivery the router must encapsulate it in a new frame with the correct local MAC address as the destination. If the data must be forwarded to another broadcast domain, the router must encapsulate the Layer 3 packet in a new Layer 2 frame that contains the MAC address of the next internetworking device. In this way a frame is transmitted through networks from broadcast domain to broadcast domain and eventually delivered to the correct host.

Routed protocols, such as IP, transport data across a network. Routing protocols allow routers to choose the best path for data from source to destination. These routes can be either static routes, which are entered manually, or dynamic routes, which are learned through routing protocols. When dynamic routing protocols are used, routers use routing update messages to communicate with one another and maintain their routing tables. Routing algorithms use metrics to process routing updates and populate the routing table with the best routes. Convergence describes the speed at which all routers agree on a change in the network.

Interior gateway protocols (IGP) are routing protocols that route data within autonomous systems, while exterior gateway protocols (EGP) route data between autonomous systems. IGPs can be further categorized as either distance-vector or link-state protocols. Routers using distance-vector routing protocols periodically send routing updates consisting of all or part of their routing tables. Routers using link-state routing protocols use link-state advertisements (LSAs) to send updates only when topological changes occur in the network, and send complete routing tables much less frequently.

As a packet travels through the network devices need a method of determining what portion of the IP address identifies the network and what portion identifies the host. A 32-bit address mask, called a subnet mask, is used to indicate the bits of an IP address that are being used for the network address. The default subnet mask for a Class A address is 255.0.0.0. For a Class B address, the subnet mask always starts out as 255.255.0.0, and a Class C subnet mask begins as 255.255.255.0. The subnet mask can be used to split up an existing network into subnetworks, or subnets.

Subnetting reduces the size of broadcast domains, allows LAN segments in different geographical locations to communicate through routers and provides improved security by separating one LAN segment from another.

Custom subnet masks use more bits than the default subnet masks by borrowing these bits from the host portion of the IP address. This creates a three-part address:

• The original network address

• The subnet address made up of the bits borrowed

• The host address made up of the bits left after borrowing some for subnets

Routers use subnet masks to determine the subnetwork portion of an address for an incoming packet. This process is referred to as logical ANDing.

Calculating the resident subnetwork through ANDing

Calculating the resident subnetwork through ANDing
10.3.6 This page will explain the concept of ANDing.


Routers use subnet masks to determine the home subnetwork for individual nodes. This process is referred to as logical ANDing. ANDing is a binary process by which the router calculates the subnetwork ID for an incoming packet. ANDing is similar to multiplication.

This process is handled at the binary level. Therefore, it is necessary to view the IP address and mask in binary. The IP address and the subnetwork address are ANDed with the result being the subnetwork ID. The router then uses that information to forward the packet across the correct interface.

Subnetting is a learned skill. It will take many hours performing practice exercises to gain a development of flexible and workable schemes. A variety of subnet calculators are available on the web. However, a network administrator must know how to manually calculate subnets in order to effectively design the network scheme and assure the validity of the results from a subnet calculator. The subnet calculator will not provide the initial scheme, only the final addressing. Also, no calculators, of any kind, are permitted during the certification exam.

This page concludes this lesson. The next page will summarize the main points from the module.

Subnetting Class A and B networks

Subnetting Class A and B networks
10.3.5 This page will describe the process used to subnet Class A, B, and C networks.


The Class A and B subnetting procedure is identical to the process for Class C, except there may be significantly more bits involved. The available bits for assignment to the subnet field in a Class A address is 22 bits while a Class B address has 14 bits.

Assigning 12 bits of a Class B address to the subnet field creates a subnet mask of 255.255.255.240 or /28. All eight bits were assigned in the third octet resulting in 255, the total value of all eight bits. Four bits were assigned in the fourth octet resulting in 240. Recall that the slash mask is the sum total of all bits assigned to the subnet field plus the fixed network bits.

Assigning 20 bits of a Class A address to the subnet field creates a subnet mask of 255.255.255.240 or /28. All eight bits of the second and third octets were assigned to the subnet field and four bits from the fourth octet.

In this situation, it is apparent that the subnet mask for the Class A and Class B addresses appear identical. Unless the mask is related to a network address it is not possible to decipher how many bits were assigned to the subnet field.

Whichever class of address needs to be subnetted, the following rules are the same:

Total subnets = 2 to the power of the bits borrowed
Total hosts = 2 to the power of the bits remaining
Usable subnets = 2 to the power of the bits borrowed minus 2
Usable hosts = 2 to the power of the bits remaining minus 2

The next page will discuss logical ANDing.

Applying the subnet mask

Applying the subnet mask
10.3.4 This page will teach students how to apply a subnet mask.
Once the subnet mask has been established it then can be used to create the subnet scheme. The chart in Figure is an example of the subnets and addresses created by assigning three bits to the subnet field. This will create eight subnets with 32 hosts per subnet. Start with zero (0) when numbering subnets. The first subnet is always referenced as the zero subnet.

When filling in the subnet chart three of the fields are automatic, others require some calculation. The subnetwork ID of subnet zero is the same as the major network number, in this case 192.168.10.0. The broadcast ID for the whole network is the largest number possible, in this case 192.168.10.255. The third number that is given is the subnetwork ID for subnet number seven. This number is the three network octets with the subnet mask number inserted in the fourth octet position. Three bits were assigned to the subnet field with a cumulative value of 224. The ID for subnet seven is 192.168.10.224. By inserting these numbers, checkpoints have been established that will verify the accuracy when the chart is completed.

When consulting the subnetting chart or using the formula, the three bits assigned to the subnet field will result in 32 total hosts assigned to each subnet. This information provides the step count for each subnetwork ID. Adding 32 to each preceding number, starting with subnet zero, the ID for each subnet is established. Notice that the subnet ID has all binary 0s in the host portion.

The broadcast field is the last number in each subnetwork, and has all binary ones in the host portion. This address has the ability to broadcast only to the members of a single subnet. Since the subnetwork ID for subnet zero is 192.168.10.0 and there are 32 total hosts the broadcast ID would be 192.168.10.31. Starting at zero the 32nd sequential number is 31. It is important to remember that zero (0) is a real number in the world of networking.

The balance of the broadcast ID column can be filled in using the same process that was used in the subnetwork ID column. Simply add 32 to the preceding broadcast ID of the subnet. Another option is to start at the bottom of this column and work up to the top by subtracting one from the preceding subnetwork ID.

The next page will discuss subnetting for Class A, B, and C networks.

Establishing the subnet mask address

Establishing the subnet mask address
10.3.3 This page provides detailed information about subnet masks and how they are established on a network.


Selecting the number of bits to use in the subnet process will depend on the maximum number of hosts required per subnet. An understanding of basic binary math and the position value of the bits in each octet is necessary when calculating the number of subnetworks and hosts created when bits were borrowed.

The last two bits in the last octet, regardless of the IP address class, may never be assigned to the subnetwork. These bits are referred to as the last two significant bits. Use of all the available bits to create subnets, except these last two, will result in subnets with only two usable hosts. This is a practical address conservation method for addressing serial router links. However, for a working LAN this would result in prohibitive equipment costs.

The subnet mask gives the router the information required to determine in which network and subnet a particular host resides. The subnet mask is created by using binary ones in the network bit positions. The subnet bits are determined by adding the position value of the bits that were borrowed. If three bits were borrowed, the mask for a Class C address would be 255.255.255.224. This mask may also be represented, in the slash format, as /27. The number following the slash is the total number of bits that were used for the network and subnetwork portion.

To determine the number of bits to be used, the network designer needs to calculate how many hosts the largest subnetwork requires and the number of subnetworks needed. As an example, the network requires 30 hosts and five subnetworks. A shortcut to determine how many bits to reassign is by using the subnetting chart. By consulting the row titled ”Usable Hosts”, the chart indicates that for 30 usable hosts three bits are required. The chart also shows that this creates six usable subnetworks, which will satisfy the requirements of this scheme. The difference between usable hosts and total hosts is a result of using the first available address as the ID and the last available address as the broadcast for each subnetwork. Borrowing the appropriate number of bits to accommodate required subnetworks and hosts per subnetwork can be a balancing act and may result in unused host addresses in multiple subnetworks. The ability to use these addresses is not provided with classful routing. However, classless routing, which will be covered later in the course can recover many of these lost addresses.

The method that was used to create the subnet chart can be used to solve all subnetting problems. This method uses the following formula:

Number of usable subnets = two to the power of the assigned subnet bits or borrowed bits, minus two. The minus two is for the reserved addresses of network ID and network broadcast.

(2 power of borrowed bits) – 2 = usable subnets

(23) – 2 = 6

Number of usable hosts = two to the power of the bits remaining, minus two (reserved addresses for subnet id and subnet broadcast).

(2 power of remaining host bits) – 2 = usable hosts

(25) – 2 = 30

The next page will explain how a subnet mask is applied.