Professional Documents
Culture Documents
Network Fundamental - 5 PDF
Network Fundamental - 5 PDF
Objectives
After studying this unit, you should be able to:
Identify the functions of network layer
Explain the concept of switching
Describe circuit switching networks
Explain the concept of packet switching
Discuss the concept of routing
Know about various routing algorithms
Explain the concept of congestion control
Describe traffic shaping approach
Explain queuing disciplines such as FIFO and FQ
Identify the techniques used for congestion avoidance
Explain internetworking concepts
Describe the concept of Internet Protocol (IP)
Explain datagrams in Internet Protocol (IP)
7.1 Introduction
In this lesson, you will study the functions of network layer. The network layer deals with
forwarding packets from the source node to the destination node using different routes.
Hence, the network layer transports traffic between devices that are not locally
attached. In doing so, it controls the operation of the subnet, which involves routing of
the packets from the source to destination. This lesson will cover various switching
concepts. You will also learn about the concept of routing.
The Network layer which is lowest layer deals with end-to-end transmission. The
main aim of the network layer is to permit end-systems, connected to various networks,
to exchange information via intermediate systems known as router.
Notes
Switching
Node
A B
Notes
Figure 7.3: A Connection between Two Systems A & D Formed from 3 Links
Network use is started by a connection phase, during which a circuit is set up
among source and destination, and terminated by a disconnect phase. Figure 7.4
illustrates these phases, with associated timings:
Message
Message
Switching
Smaller packets
Node
Message broken reassembled into
into smaller message
packets
Notes
(The message in this case has been broken into three parts labeled 1-3)
Notes
Figure 7.9: A Connection between Two Systems A & D Formed from 3 Links
For instance, when a telex (or email) message is sent from A to D, it first passes
over a local connection (AB). It is then passed at some later time to C (via link BC), and
from there to the destination (via link CD). At every message switch, the received
message is stored, and a connection is subsequently made to deliver the message to
the neighboring message switch.
algorithm. The desirable properties of the routing algorithms are correctness, simplicity,
robustness, stability, fairness and optimality.
Notes
Hence, the routing algorithm is defined as the part of the network layer software
deciding which output line an incoming packet should be transmitted on. It all depends
upon if the subnet uses datagrams internally, this decision is made a new for every
arriving data packet since the best route may have changed since last time. If the
subnet using virtual circuits such decision is made ones per session.
Figure 7.12 shows the routing table for router A (address 138.25.10.1). This table
lists destination addresses for each local network, and not for each destination host.
This table also includes as the next hop (the address of next router) to which the packet
must be transferred. If no hops are included, this means that the destination network is
directly connected to the router.
When router A receives a packet, it tracks this table to perform routing. Example: If
the packets addressed to the host of network 138.25.40.0, then router A sends the
packet to router C (138.25.30.1). Router C has a similar routing table so that it can
perform routing.
Optimality Principle
The optimality principle defines that if router A is on the optimal path from router B to
router C, then the optimal path from A to C also falls along the same route.
Consequently, the set of optimal routes from all sources to a given destination form a
tree rooted at the destination. Such tree is called a sink tree.
Flooding
You must note that flooding is another static algorithm where every incoming packet is
forwarded to every outgoing line except the one from where it arrived on the router. It,
thus, generates infinite number of duplicate packets. To control the number of packets
so generated, a measure namely hop counter is applied. In this method, the header of
each packet is decremented at each hop with the packet being discarded till the counter
reaches zero. If the source host knows the path from source to destination, he initialises
the hop counter to the length of the path from source to destination. If the sender does
not have an idea of the path length, he initializes the counter to the full diameter of the
subnet.
Alternatively, a track of the packets that are flooding the communication link is kept
so that they could not be sent out a second time. The source router puts a sequence
number in each packet it receives from its hosts. Then each router needs a list per
source router indicating which sequence numbers originating at that source have been
seen to avoid any incoming packet on the list. Each list is incremented by a counter, k,
indicating that all sequence numbers through k have been seen. This prevents list from
growing unnecessarily.
Selective Flooding
Selective flooding, which slightly more practical is a variation of flooding. Every
incoming packet is not forwarded to each line. Instead, incoming packets are forwarded
only to those going approximately in the right direction.
Flow-based Routing
Unlike the algorithms discussed above based on topology only, the flow based routing
takes into account the topologic and the load. The networks, which have the mean data
flow between each pair of nodes is relatively stable and predictable offers to analyse the
flows mathematically to optimize the routing. The flow analysis makes it possible to
compute the mean packet delay on the line from queuing theory, for which the capacity
and average flow are known. This, in turn, calculates a flow-weighted average to obtain
the mean packet delay for the whole subnet. However, this technology demands certain
information.
the merged table to its neighbours. This is shown in Figure 5.13. This occurs
dynamically after a fixed time interval by default, thus requiring significant link overhead.
Notes
Notes
Hierarchical Routing
It is important to note that because of the global nature of Internet system and ever
growing networks in size, it becomes more difficult to centralize the system
management and operation. For this reason, the system must be hierarchical such that
it is organised into multiple levels, with several group loops connected with one another
at each level. The routers are divided into regions with each router knowing all the
details about how to route packets within its own region but knowing nothing about the
internal structure of other regions. Therefore, hierarchical routing is commonly used for
such a system as shown in the Figure 7.15.
A set of networks interconnected by routers within a specific area using the same
routing protocol is called domain. Two or more domains may be further combined to
Notes form a higher-order domain. A router within a specific domain is called intra-domain
router. A router connecting domains is called inter-domain router. A network composed
of inter-domain routers is called backbone .Each domain, which is also called operation
domain, is a point where the system operation is divided into plural organizations in
charge of operation. Domains are determined according to the territory occupied by
each organisation.
You must understand that routing protocol in such an Internet system can be
broadly divided into two types:
1. Intra-domain routing
2. Inter-domain routing.
Each of these protocols is hierarchically organized. For communication within a
domain, only the former routing is used. However, both of them are used for
communication between two or more domains.
Two algorithms, Distance-Vector Protocol and Link-State Protocol, are available to
update contents of routing tables.
Broadcast Routing
In broadcast routing, the source machine intends to send messages to many or all other
hosts. Example: Stock exchange reports, sports news like cricket match score, flights
schedules, etc.
Hence sending the same message to several recipients is broadcast and the
algorithm doing so is called broadcast algorithm. To accomplish the task the following
methods are proposed:
The simplest method is that source machine sends the packet to all the necessary
destination machines. In doing so, the source machine needs to maintain the complete
Multicast Routing
It is important to note that sometimes, there are groups that are working and
exchanging information among group members. Hence, sending information to well-
defined groups that have large members, but small as compared to the network, as a
whole is called multicasting. The routing algorithm making it possible is called multicast
routing. If the group is small, sending messages point to point will suffice but if the
group is large, point to point transferring messages would be inefficient. In such a
situation broadcasting will also not be proved efficient because messages may not be of
interest of all the recipients and messages may also be classified.
The multicast routing algorithm involves update list of all process in a group
available with source or host machine.
is accomplished either by router to query their hosts periodically to know about the
new members in groups or by the hosts informing their routers about changes in-group
membership.
In multicast routing, each router computes a spanning tree for all other routers in
the subnet. On receipt of a multicast packet for a group at a router, that router examines
its spanning tree and prunes the multicast packet so that all lines that do not lead to
hosts that are members of the group could be removed.
The pruning of the spanning tree involves Link State routing when each router is
aware of the complete subnet topology including which hosts belong to which groups.
Thereafter, the spanning tree is pruned from beginning at the end to each path and
moving towards the root. Thus all routers that do not belong to the group are removed.
In distance vector routing, reverse path forwarding algorithm is followed. In such a
case, when a router that has neither a host for a group nor a connection to other routers
receives a multicast message for that group, it responds with a PRUNE message,
indicating the sender not to forward it any more multicasts for that group. When a router
with no group members among its own hosts has received such messages on all its
lines, it also responds with a PRUINE message. In this way, the subnet is recursively
pruned.
Notes
The major disadvantage of this algorithm is that it scales inefficiently to large
networks. To overcome this problem, another method, a core-base tree is used. This
computes a single spanning tree per group with the root (the core) near the middle of
the group. A host sends a multicast message to the core, which then performs the
multicast along the spanning tree. The advantage of this method is reduction in storage
costs from multiple trees to one tree per group.
Incoming packets
Outgoing packets
Notes It is important to note that the idea of FIFO (first-come-first-served) queuing is simple:
The first packet that arrives at a router is the first packet to be transmitted. You can see
this figure 7.17(a), which shows a FIFO with “slots” to hold up to eight packets. Given
that the amount of buffer space at every router is finite, if a packet arrives and the
queue (buffer space) is full, then the router discards that packet, as shown in Figure
7.17 (b). This is done without regard to which flow the packet belongs to or how
significant the packet is. At times, this is known as tail drop, as packets that arrive at the
tail end of the FIFO are dropped.
You must observe that as FIFO and tail drop are the simplest instances of
scheduling discipline and drop policy, respectively, they are sometimes viewed as a
bundle—the vanilla queuing implementation.
Figure 7.17: (a) FIFO Queuing; (b) Tail Drop at a FIFO Queue
FIFO with tail drop, as the simplest of every queuing algorithm, is the most
extensively used in Internet routers at the time of writing. This simple method to queuing
pushes all responsibility for congestion control and resource allocation out to the edges
of the network. Therefore, the prevalent form of congestion control in the Internet
currently assumes no help from the routers: TCP takes accountability for identifying and
responding to congestion.
Notes
When multiple hosts detect that there is congestion in the network, it is possible that
they can all half their congestion windows and back off exponentially, resulting in an
Notes underutilization in the channel. This is called global synchronization and it is an
unwanted behaviour in the network. UDP on the other hand, does not have a built in
congestion control mechanism. However, since UDP does not guarantee delivery of
data, it doesn’t send packets multiple times when a timeout occurs.
Generally, congestion avoidance algorithms use the additive increase multiplicative
decrease mechanism of TCP in order to avoid congestion by attempting to force the
sender hosts to reduce their congestion windows. Now, you will study the methods to
accomplish this.
7.7.1 DECbit
You must note that in DECbit method, routers set a binary congestion bit in the packet
when the network is about to experience congestion. Then, the destination host copies
this DECbit to its acknowledgement and sends it back to the sender node. When the
sender node obtains the acknowledgement, it determines that the network is
overloaded and thus halves its congestion window.
A single congestion bit is added to the packet header. A router sets this bit in a
packet if its average queue length is greater than or equal to 1 at the time the packet
arrives. This average queue length is measured over a time interval that spans the last
busy + idle cycle, plus the current busy cycle. This is to note that the router is busy
when it is transmitting and idle when it is not. In Figure 8.4, you can see the queue
length at a router as a function of time. Basically, the router calculates the area under
the curve and divides this value by the time interval to compute the average queue
length. Using a queue length of 1 as the trigger for setting the congestion bit is a trade-
off between significant queuing (and therefore higher throughput) and increased idle
time (and therefore lower delay). Alternatively, a queue length of 1 seems to optimise
the power function.
Source: http://www.sahyadri.edu.in/SMCA/students_guide/3semnotes/network/Computer_Networks_
Peterson__A_ Systems_Approach__Fourth_Edition.pdf
the TCP/IP protocol suite. ARPANET was basically a network based on leased lines
connected by special switching nodes, known as Internet Message Processors (IMP).
Notes Many researchers were involved in TCP/IP research by 1979. This motivated DARPA to
form an informal committee to coordinate and guide the design of the communication
protocols and architecture. The committee was called the Internet Control and
Configuration Board (ICCB).
It is important to note that the first real implementation of the Internet was when
DARPA converted the machines of its research network ARPANET to use the new
TCP/IP protocols. After this transition, DARPA demanded that all computers willing to
connect to its ARPANET must use TCP/IP. The success of ARPANET was more than
the expectations of its own founders and TCP/IP internetworking became widespread.
As a result, new Wide Area Networks (WAN) were created and connected to ARPANET
using TCP/IP protocol. In turn, other networks in the rest of the world, not necessarily
based on the TCP/IP protocols, were added to the set of interconnected networks.
Computing facilities are currently connected to the Internet via their own sub-networks,
constituting the world’s largest network. In 1990, ARPANET was eliminated, and the
Internet was declared as the formal global network.
DARPA also funded a project to develop TCP/IP protocols for Berkeley UNIX on the
VAX and to distribute the developed codes free of charge with their UNIX operating
system. The first release of the Berkeley Software Distribution (BSD) to include the
TCP/IP protocol set was made available in 1983 (4.2BSD). This led to the spread of
TCP/IP among universities and research centers and has become the standard
communications subsystem for all UNIX connectivity.
7.8.3 Internet
You must understand that the word Internet is a short form of a complete word
internetwork or interconnected network. Therefore, it can be said that the Internet is not
a single network, but a collection of networks. Internet is a form of resource sharing.
The commonality between them in order to communicate with each other is TCP/IP.
The Internet consists of the following groups of networks:
Backbones: These are large networks that exist primarily to interconnect other
networks. Example: Some examples of backbones are NSFNET, EBONE and large
commercial backbones.
Regional networks: These connect, for example, universities and colleges.
Example: ERNET (Education and Research Network) is an example in the Indian
context.
Commercial networks: They provide access to the backbones to subscribers, and
networks owned by commercial organizations for internal use and also have
connections to the Internet. Mainly, Internet Service Providers come into this category.
Local networks: These are campus-wide university networks.
The networks connect users to the Internet using special devices that are called
gateways or routers. These devices provide connection and protocol conversion of
dissimilar networks to the Internet. Gateways or routers are responsible for routing data
around the global network until they reach their ultimate destination as shown in Figure
7.21. The delivery of data to its final destination takes place based on some routing
table maintained by router or gateways. These are mentioned at various places in this
book, as these are the fundamental devices to connect similar or dissimilar networks
together.
Over time, TCP/IP defined several protocol sets for the exchange of routing
information. Each set pertains to a different historic phase in the evolution of
architecture of the Internet backbone.
Notes Routing is defined as the act of moving information across an internetwork from a
source to a destination. Along the way, at least one intermediate node usually is
encountered. Routing is often contrasted with bridging, which might seem to achieve
precisely the same thing to the casual observer. Routing takes place at Layer 3 (the
network layer).
You must understand that to interconnect networks different hardware is required at
different layers. Repeaters or hubs that amplify and forward the signal from one network
to another are required at physical layer. The data link layer uses bridges and switches
that read the packet to decide as to whether the data is to be forwarded or it belongs to
the same network from where it originated. Routers or multiprotocol routers connect two
networks at the network layer to decide the best possible path for delivery of packets.
Routing includes two basic activities: finding out optimal routing paths and
transporting information groups (usually known as packets) through an internetwork. In
the context of the routing process, the latter of these is known as packet switching.
Even though packet switching is comparatively straightforward, path determination can
be very complex.
Routing algorithms can be differentiated based on various key characteristics. First,
the particular goals of the algorithm designer affect the operation of the resulting routing
protocol. Second, several types of routing algorithms exist, and every algorithm has a
different impact on network and router resources. Finally, routing algorithms use a
variety of metrics that affect calculation of optimal routes.
Routing algorithms consists of the following design goals:
Optimality: It refers to the capability of the routing algorithm to choose the best
route, which relies on the metrics and metric weightings used to make the
calculation. For example, one routing algorithm may use a number of hops and
delays, but it may weigh delay more heavily in the calculation. Naturally, routing
protocols must define their metric calculation algorithms strictly.
Simplicity and low overhead: Routing algorithms are designed to be as simple as
possible. Alternatively, the routing algorithm must provide its functionality efficiently,
with a minimum of software and utilization overhead. Efficiency is particularly
significant when the software implementing the routing algorithm must run on a
computer with limited physical resources.\
Robustness and stability: Routing algorithms must be robust. It signifies that they
should perform correctly in the face of unusual or unforeseen circumstances, such
as hardware failures, high load conditions, and incorrect implementations. As
routers are located at network junction points, they can cause considerable
problems when they fail. The best routing algorithms are often those that have
withstood the test of time and that have proven stable under a variety of network
conditions.
Rapid convergence: Routing algorithms must converge rapidly. Convergence is
considered as the process of agreement, by all routers, on optimal routes. When a
network event causes routes to either go down or become available, routers
distribute routing update messages that permeate networks, stimulating
recalculation of optimal routes and eventually causing all routers to agree on these
routes. Routing algorithms that converge slowly can cause routing loops or network
outages.
Flexibility: Routing algorithms should also be flexible, which signifies that they
should quickly and accurately adapt to various network circumstances. Example:
Assume that a network segment has gone down. As many routing algorithms
become aware of the problem, they will quickly select the next-best path for all
routes normally using that segment. Routing algorithms can be programmed to
adapt to changes in network bandwidth, router queue size, and network delay,
among other variables. Routing algorithms within homogeneous networks are
Virtual circuits can also known as logical circuits, and it is significant to keep in mind
that while the circuit can change its path and connect to different networks or points, it
Notes still only connects two points at one time. It determines what two connections it needs to
make and sets up the best path for a smooth and fast transfer. For this reason it
appears to be a normal circuit connection that stays in place. The difference lies in how
the circuit can choose two different points to create a new connection when necessary.
This allows for fast transfers among various networks using fewer resources.
Source: http://www-users.aston.ac.uk/~blowkj/internetworks/lecture10/img2.html
7.9.2 Datagrams
The term 'datagram' or 'packet' is utilized to describe a chunk of IP data.
You must remember that the IP datagram has a header of 20-byte fixed size and a
text of variable length optional parts. The header format of IP datagram is depicted in
Figure 7.24. The header format is transmitted from left to right, with the high order bit of
Version field is transmitted first.
1. 32 Bits
2. Version 3. IHL 4. Types of 5. Total length
service
6. Identification 7. 8. DF 9. MF 10. Fragment
Offset
11. Time to Live 12. Protocol 13. Header checksum
14. Source Addresses
15. Destination Addresses
16. Options (0 or more words)
Data encapsulation adds the IP header to the data. The IP header consists of five
or six 32-bit words; the sixth word is attributed to the IP options field. The different fields
Notes of the IP header are given as below:
Version refers to the version of the IP protocol in use and keeps track of the version
of the protocol to which the datagram belongs to. The current version of IP is 4.
Internet Header Length (IHL) indicates the length of the header field in 32-bit words.
The minimum value of the header field is 5 that apply when no option is present. The
maximum value of this 4 bit filed is 15 that restricts the header to 60 bytes and thus
Option field to 40 byte.
Type of service enables the host to indicate the subnet what kind of service (e.g.,
reliability and speed) it wants. It refers to any of the type of services that IP supports.
Desired service type is normally specified by user level applications. Example: Service
type include minimum and maximum throughput, requested by applications such as the
File Transfer Protocol (FTP) and Simple Mail Transfer Protocol (SMTP).
Total length has everything in the datagram (max. 64 KB). If it is subtracted from the
IHL field, it indicates to IP the actual length of the data field.
Identification enables the destination host to determine which datagram a newly
arrived fragment belongs to.
DF means do not Fragment.
MF is for More Fragments.
Fragment offset indicates the source location of the current datagram. The
elementary fragment unit size is 8 bytes.
Time to live that counts hops is expressed in seconds. A zero count indicates that
the packet is discarded. TTL is employed by IP to prevent a lost datagram from
endlessly looping around the network. IP achieves this objective by initializing the TTL
field to the maximum number of routers that the packet can traverse on the network.
Protocol indicates the destination which transports process to give the datagram to
(TCP, UDP, or others).
Header checksum verifies the header only. The algorithm is to add up all the 16-bit
halfwords as they arrive, using one's complement arithmetic.
Source/Destination address tells the network number and host number.
It is important to note that options provides an escape to allow subsequent versions
of the protocol to have information not present in the original design, to allow
experimenters to try out new ideas, and to avoid allocating header bits to information
that is rarely needed. On its presence, it includes optional control information. Example:
An example of optional information includes the route record, which includes a record of
every router that the datagram traversed during its trip around the network.
7.9.3 IP Addresses
Using Internet has become common. You will now understand how Internet interprets
the Internet address. The Internet addresses are written as www.hotmail.com, for
instance we write one more address as server.institution.domain. The address
www.hotmail.com is not actual address; it is a text version of the Internet address,
which is basically a binary representation. Now we compare www.hotmail.com, and
server.institution.domain. WWW is the name of the server owned by the institution (in
this case, it is hotmail) and this server is connected to the Internet to a domain server
namely (com in this case) which maintains a database of the addresses of different
servers using the same domain com. The domain name has no geographical relevance
and two sites with same domain name may exist at two end of this world.
IPv4 Addressing
IPv4 addresses are uniquely used as identifiers, which work at network layer to identify
the source or destination of IP packets. Presently, the version of IP, which is in use, is
called as IPv4. In this version, every node on Internet may have one or more interfaces,
and it is required to identify each of these devices with a unique address assigned to
each of them. It means that each node is assigned one or more IP addresses to invoke
TCP/IP. These are logical addresses and have 32 bits.
Technically, IP addresses are expressed using binary notation with 32 bit long
string. In order to make these strings to remember easily, dotted decimal notations are
used, in which periods or dots separate four decimal numbers from 0 to 255
representing 32 bits. As there are 32 bits therefore each decimal number contains 8 bits
and called octet.
Example: The IPv4 address 11000000101010000000101000011001 is expressed
as 192.168.10.25 in dotted decimal notation.
Below are the steps to convert an IPv4 address from binary notation to dotted
decimal notation:
1. Break 32 bit long address into segments of 8-bit blocks: 11000000 10101000
00001010 00011001
2. Write decimal equivalent of each segment: 192 168 10 25
3. Separate the blocks with periods: 192.168.10.25
192 168 10 25
8 8 6 0
Notes
192 168 8 0
This gives the subnet prefix for the IPv4 address configuration 192.168.10.25/22 as
192.168.204.0/22.
Now, you have to extract the subnet prefix from an arbitrary IPv4 address using an
arbitrary subnet mask. For this purpose a mathematical operation logical AND is used.
A logical comparison between the 32-bit IP address and the 32-bit subnet mask is
performed. It gives the subnet prefix. Example: For example, you may consider the
following possible addresses for Class C.
Class C Network Bit Representation Address Range
210.195.8.0 11010010-11000011-00001000-xxxxxxxx 210.195.8.0-211.195.8.255
210.195.9.0 11010010-11000011-00001001-xxxxxxxx 210.195.9.0-211.195.9.255
210.195.10.0 11010010-11000011-00001010-xxxxxxxx 210.195.10.0-211.195.10.255
210.195.11.0 11010010-11000011-00001011-xxxxxxxx 210.195.11.0-211.195.11.255
Notes
Source: http://www.tcpipguide.com/free/t_IPRoutesandRoutingTables-2.htm
7.10 ICMP
This section emphasises on the Internet Control Message Protocol (ICMP). ICMP, you
can say, an error reporting protocol that is an integral part of the IP protocol. ICMP
communicate control data, information data, and error recovery data across the
network. Problems that is less severe than transmission errors result in error conditions
that can be reported. Example: Suppose some of the physical paths in Internet fail,
causing the Internet to be partitioned into two sets of networks with no path between the
sets, a datagram sent from a host in one set to a host in other cannot be delivered.
The TCP/IP suite includes a protocol called ICMP that IP uses to send error
messages when condition such as the one described above arises. The protocol is
required for a standard implementation of IP. You will see that the two protocols are co-
dependent. IP uses ICMP when it sends an error message, and ICMP uses IP to
transport messages.
You must keep in mind the following brief description of some of the error
messages defined by ICMP protocol:
Source Quench: A router or host whose receive communication buffers are nearly
full normally triggers this message. A source quench message is sent to the sending
host, the receiver is simply requesting the sending host to reduce the rate at which it is
transmitting until advised otherwise.
Time Exceeded: A time-exceeded message is sent in two cases. Whenever a
router reduces the TTL field in a datagram to zero, the router discards the datagram
and sends a time-exceeded message. In addition, a time-exceeded message is sent by
a host if the reassembly timer expires before all fragments from a given datagram
arrive.
Route Redirect: A router sends this message to a computer system that is
requesting its routing services. When a computer system creates a datagram destined
for a network, it will send that datagram to a router, which will then be forwarded to its
destination. If a router finds out that a computer system has incorrectly sent a datagram
encapsulated in a frame for transmission. Figure 6.9 illustrates two levels of data
encapsulation.
Notes
ICMP Header ICMP Data Area
7.11 Summary
Network layer transports packet from sending to receiving hosts via internet. A switch is
used to interconnect different hosts to its several inputs and outputs. The circuit
switching session comprises of 3 phases like circuit establishment, data transfer and
circuit disconnect. Packet switching enables to transmit the same information to more
than one receiver at the same time. In message switching, there is no need for a
connection to be established all the way from source to destination. Cell switching is
considered to be a high speed switching technology to overcome the speed problems
for real time applications. IP routing protocol makes the distinction between hosts and
gateways. A host is the end system to which data is ultimately delivered. An IP gateway
is the router that accomplishes the act of routing data between two networks. The
routing algorithms decide which output line an incoming packet should be transmitted
on. Non-adaptive algorithms are independent of the volume of the current traffic and
topology. It includes Shortest Path Routing, Flooding, etc. Adaptive algorithms are
capable of changing their routing decisions to reflect changes in the topology and the
traffic. It includes Distance Vector Routing, link state routing, etc. Internetworking is a
scheme for interconnecting multiple networks of dissimilar technologies. Internet is not a
single network, but a collection of networks. The networks connect users to the Internet
using special devices that are called gateways or routers. To interconnect networks
different hardware is required at different layers. The basic idea behind the virtual circuit
is to building up an internetwork connection by concatenating a series of internetwork
and gateway to gateway virtual circuits. IP protocol is suitable for the sporadic
transmission of data to a number of destinations. Internet Protocol (IP) provides
unreliable, connectionless packet delivery for the Internet. IPv4 addresses are uniquely
used as identifiers, which work at network layer to identify the source or destination of
IP packets. ICMP communicate control data, information data, and error recovery data
across the network. Congestion is a global phenomenon involving all hosts, all routers,
the store-and-forward processing within the routers, etc. The traffic management facility
allows maximizing available network resources and ensures efficient use of resources
that have not been explicitly allocated. The traffic shaping approach includes
transmission of packets at uniform rate and in more predictable rate in case of open
loop method. The leaky bucket algorithm finds its use in the context of network traffic
shaping or rate limiting. A token bucket algorithm finds its uses in the context of network
traffic shaping or rate limiting. In FIFO queuing, the first packet that arrives at a router is
the first packet which is to be transmitted. The purpose of Fair Queuing is to maintain a
separate queue for every flow presently being managed by the router. Congestion
avoidance algorithms exploit the additive increase multiplicative decrease method of
TCP to avoid congestion by attempting to force the sender hosts to reduce their
congestion windows. In DEC bit method, routers set a binary congestion bit in the
packet when the network is about to experience congestion. Random early detection
(RED) is designed to be utilised in conjunction with TCP, which presently detects
congestion by using timeouts.
Objectives
After studying this unit, you should be able to:
Identify the functions of transport layer
Describe the key protocols of the transport Layer
Compare Transmission Control Protocol (TCP) and User Datagram Protocol
(UDP)
Describe elements of transport protocol
8.1 Introduction
In this lesson, you will study the functions of transport layer. The transport layer makes
the upper layers from any concern with providing reliable and cost effective data
transfer. It facilitates end-to-end control and information exchange with the quality of
service required by the application program. Thus, layer four of the OSI reference
model is the transport layer that provides transparent transfers of data between the
source and destination machines using the services of the network layer such as IP. It
enables reliable internetworking data transport services that are transparent to upper
layers. The transport layer protocol administers end-to-end control and error checking to
ensure complete data transfer. The transport layer’s job also includes breaking the
Amity Directorate of Distance & Online Education
Transport Protocol 169
messages from the session layer into segments. This lesson will cover the concept of
the user datagram protocol and transmission control protocol. You will also learn about
elements of transport protocol. Notes
It offers transparent transfer of data among end systems by using the services of
the network layer below to move PDUs of data among the two communicating systems.
The transport layer relieves the upper layers from any concern with providing reliable
and cost effective data transfer. It offers end-to-end control and information transfer with
the quality of service required by the application program.
Quality of Service
You must note that transport layer bridges the gap of the services provided by the
network and therefore enhances the quality of service provided to the users. The
possible parameters for the quality of service as offered by the transport layer are
connection establishment delay, connection establishment failure probability,
throughput, transit delay, residual error ratio, protection priority, resilience, etc.
Connection establishment delay: It is the amount of time when an
acknowledgement is received from the destination machine to which a connection is
requested. Obviously, lesser is the delay, better is the service.
Connection establishment failure probability: Due to congestion in the network,
lack of availability of space in table, some internal problem etc., causes the
connection not to set within the establishment delay.
Throughput: It defines the number of bytes of user data transferred per second in
a defined time interval. For each communication link it is measured separately.
Transit delay: It is the time gap between a transmitted data from source machine
to the reception of the same data by the destination machine. Like, throughput, for
each communication link it is measured separately.
Residual error ratio: It is the fraction of the lost data with respect to the total data
sent over the network by source machine.
Notes Protection priority: It is defined as the capability of the transport layer to provide
Protection against third parties who try to interfere with the data. It specifies the
priority of the important connections so that high priority connections are served
before the low priority connections in the event of congestion.
Resilience: It is the capability of the transport layer to terminate a connection itself
spontaneously in the case of congestion.
Transport layer cannot always fulfil all of the parameters as mentioned above. It
tries to implement a trade-off among the parameters of quality of service. This
process is called option negotiation.
8.2.2 Transport Service Primitives
They are utilised to access transport services by the application layer or the users. Each
transport service is defined with a unique transport primitive. The network layer provides
an unreliable service whereas the transport layer attempts to provide a reliable service
on top of the unreliable service. Example: Some of the examples of transport primitives
are listed below along with their functions:
LISTEN: Broadcast willingness to accept connections and provide queue size.
ACCEPT: Block the caller unless a communication attempt arrives.
CONNECT: Actively try to establish a connection.
SEND: Send data over the connection.
RECEIVE: Receive data from the connection.
CLOSE: Release the connection.
In the client server architecture, a machine (client) requests to another machine (server)
to create a connection for providing some service. The services running on the server
run on ports. The ports are application identifiers. The client machine should know the
address of the server machine for getting the desired services from this port and to
connect to the server machine. However, the server machine should not know the
address or the port of the client machine at the time of connection initiation. The first
packet transmitted by the client machine as a request to the server machine contains
details about the client which are further used by the server to send any information.
Client machine acts as the active device which makes the first move to establish the
connection whereas the server machine passively waits for such requests from some
client.
The transport layer uses the network layer primitives to send and receive TPDUs.
Transport Protocol Data Unit (TPDU) is a term used for exchanging data from transport
entity to transport entity.
The transport entity resides in:
the host operating system kernel,
a separate user process,
a package of library routines running within the user’s address space, or
a coprocessor chip or network board plugged into the host’s backplane.
The interface to the network layer is given as below:
to_net(int cid, int q, int m, pkt_type pt, unsigned char *p, int bytes);
from_net(int *cid, int *q, int *m, pkt_type *pt,
Retransmission Timeout
In some implementation (E.g.. Linux), RTO = RTT + 4 * delay variance is used to
instead of constant 2.
Also instead of calculating RTT(est) from the scratch, cache will be used to store the
history from which new values are calculated as discussed in the previous classes.
Standard values for Maximum Segment Life (MSL) will be between 0.5 to 2 minutes and
Time wait state = f(MSL)
Keep Alive Time
Another important timer in TCP is keep alive timer. It is basically used by a TCP peer to
check whether the other end is up or down. It periodically checks this connection. If the
other end did not respond, then that connection will be closed.
Persist Timer
As we saw in TCP window management, when source sends one full window of
packets, it will set its window size to 0 and expects an ACK from remote TCP to
increase its window size. Suppose such an ACK has been sent and is lost. Hence
source will have current window size = 0 and cannot send & destination is expecting
next byte. To avoid such a deadlock, a Persist Timer will be used. When this timer goes
off, the source will send the last one byte again. So we hope that situation has improved
and an ACK to increase the current window size will be received.
In this section, you will learn about the internet transmission protocol. The key protocols
of the Transport Layer are Transmission Control Protocol (TCP) and User Datagram
Notes Protocol (UDP). TCP enables reliable data delivery service with end-to-end error
detection and correction. UDP facilitates low-overhead, connectionless datagram
delivery service. Both protocols are responsible for delivering data between the session
layer and the network layer. Now, you will understand the concept of UDP and TCP.
8.3.1 User Datagram Protocol (UDP)
You must note that the User Datagram Protocol enables application programs to have
direct access to a datagram delivery service like the delivery service that IP provides.
This enables applications to exchange messages over the network with a minimum of
protocol overhead. UDP is connectionless unreliable datagram protocol in which the
sending terminal does not check whether data has been received by receiving terminal.
The unreliable service indicates that there is no guarantee that the data reaches at the
receiving end of the network correctly. You can understand it more clearly by Figure
1.1.
However, this protocol makes it possible to omit a variety of processes thus reducing
the load on the CPU. UDP has 16-bit Source Port and Destination Port numbers. Figure
1.2 shows the data structure of the UDP header. The simplicity of the UDP header
stems from the unsophisticated nature of the services it provides.
UDP port numbers allow different applications to maintain their own "channels" for data;
both UDP and TCP use this mechanism to support multiple applications sending and
receiving data concurrently. The sending application (that could be a client or a server)
sends UDP datagrams through the source port, and the recipient of the packet accepts
this datagram through the destination port. Some applications use static port numbers
that are reserved for or registered to the application. Other applications use dynamic
(unregistered) port numbers. Because the UDP port headers are two bytes long, valid
port numbers range from 0 to 65535; by convention, values above 49151 represent
dynamic ports.
Notes
The datagram size is a simple count of the number of bytes contained in the header and
data sections . Because the header length is a fixed size, this field essentially refers to
the length of the variable-sized data portion (sometimes called the payload). The
maximum size of a datagram varies depending on the operating environment. With a
two-byte size field, the theoretical maximum size is 65535 bytes. However, some
implementations of UDP restrict the datagram to a smaller number -- sometimes as low
as 8192 bytes.
UDP checksums work as a safety feature. The checksum value represents an encoding
of the datagram data that is calculated first by the sender and later by the receiver.
Should an individual datagram be tampered with (due to a hacker) or get corrupted
during transmission (due to line noise, for example), the calculations of the sender and
receiver will not match, and the UDP protocol will detect this error. The algorithm is not
fool-proof, but it is effective in many cases. In UDP, check summing is optional --
turning it off squeezes a little extra performance from the system -- as opposed to TCP
where checksums are mandatory. It should be remembered that check summing is
optional only for the sender, not the receiver. If the sender has used checksum then it is
mandatory for the receiver to do so.
Usage of the Checksum in UDP is optional. In case the sender does not use it, it sets
the checksum field to all 0's. Now if the sender computes the checksum then the
recipient must also compute the checksum an set the field accordingly. If the checksum
is calculated and turns out to be all 1's then the sender sends all 1's instead of all 0's.
This is since in the algorithm for checksum computation used by UDP, a checksum of
all 1's if equivalent to a checksum of all 0's. Now the checksum field is unambiguous for
the recipient, if it is all 0's then checksum has not been used, in any other case the
checksum has to be computed.
8.3.2 Transmission Control Protocol
It provides a connection type service. That is, a logical connection must be established
prior to communication. Because of this a continuous transmission of large amount of
data is possible. It ensures a highly reliable data transmission for upper layers using IP
protocol. This is possible because TCP uses positive acknowledgement to confirm the
sender about the proper reception of data as shown in Figure 1.4.
The sender keeps on send data at constant intervals until it receives a positive
acknowledgement.A negative acknowledgment implies that the failed data segment
needs to be retransmitted.
You must take into consideration what happens when a packet is lost on the network
and fails to reach its ultimate destination? When host A sends data, it starts a time
down counter. If the timer expires without receiving an acknowledgment, host A
assumes that the data segment was lost. Consequently, the sending computer
retransmits a duplicate of the failing segment.
Data Segment 2
Acknowledgment 2
A B
back to the source end. When the data segment is damaged, the destination machine
discards it.
Notes
When the source machine does not receive any positive acknowledgement within a
specified time out period, it re-transmits the data segment.
Connection-oriented: You must note that TCP creates a logical end-to-end connection
between the source and destination hosts. Handshake that is control information is
exchanged between the source and destination hosts to set a dialogue before data is
sent. TCP indicates the control function in a segment by setting the flag in a Flags field
in the segment header. TCP uses a three-way handshake that indicates that three
segments are exchanged. Figure 1.6 depicts the simplest form of the three-way
handshake.
Host A initiates the connection by transmitting host B a segment with the “Synchronize
sequence numbers” (SYN) bit set. This segment indicates to host B that host A
requests to create a connection. The segment also indicates to host B the sequence
number host A will use as a starting number for its segments so that data can be put in
the proper order. Host B replies to host A with a segment that has the
“Acknowledgment” (ACK) and SYN bits set. Host B’s segment acknowledges the
receipt of A’s segment and tells host A the Sequence Number host B will begin with.
Finally, host A transmits a segment that acknowledges receipt of host B’s segment.
Thus, host A transfers the first actual data.
unreliable entirely. The order of the received message may or may not be the same in
which it was transmitted. When the connection is created between two processes,
Notes transport layer determines the type of service to be provided to session layer at that
time.
8.4.2 Connection Establishment/Release
It is essential to understand that the transport layer creates and releases the connection
across the network. This includes naming mechanism so that a process on one
machine can indicate with whom it wishes to communicate. The transport layer enables
to establish and delete connections across the network to multiplexing several message
streams onto one communication channel.
8.4.3 Flow Control
The underlying rule of flow control is to maintain a synergy between a fast process and
a slow process. Transport layer enables a fast process to keep pace with a slow one.
Acknowledgements are sent back to manage end-to-end flow control. Go back N
algorithms is used to request retransmission of packets starting with packet number N.
Selective Repeat is used to request specific packets to be retransmitted.
8.4.4 Error Control
Error detection and error recovery are the integral part of a reliable service and
therefore they are necessary to perform error control mechanism on end-to-end basis.
To control errors from lost or duplicate segments the transport layer enables unique
segment sequence numbers to the different packets of message, creating virtual
circuits, allowing only one virtual circuit per session. Time-outs mechanism is also used
to remove the packets from the network segments that have been misrouted and have
remained on the network beyond a specified time.
End-to-end error control using checksums are also used to handle any corruption in
data.
8.4.5 Multiplexing/Demultiplexing
You must be aware that the transport layer establishes separate network connection for
each transport connection required by the session layer. To improve throughput, the
transport layer establishes multiple network connections. When the issue of throughput
is not important, it multiplexes several transport connections onto the same network
connection, thus reducing the cost for establishing and maintaining the network
connections. When several connections are multiplexed, they call for demultiplexing at
the receiving end. In case of transport layer, the communication takes place only
between two processes and not between two machines. Hence, the communication at
transport layer is also known as peer-to-peer or process-to-process communication.
8.4.6 Addressing
Transport Layer deals with addressing or labelling a frame. It also differentiates
between a connection and a transaction. Connection identifiers are ports or sockets that
label each frame so the receiving device knows which process it has been sent from.
This helps in keeping track of multiple-message conversations. Ports or sockets
address multiple conservations in the same location.
Example: The first line of a postal address is analogous of port and distinguishes
among several occupants of the same house.
Computer applications listen for information on their own ports and therefore more than
one network-based application may be used at the same time. The transaction
identifiers deal with the request or response frames. They are one-time events.
8.5 Performance issues
In view of thousands of computers in a network and scaling up of the network imposes
issues of complex interactions with unforeseen consequences that leads to poor
Amity Directorate of Distance & Online Education
Transport Protocol 183
performance and no one knows why. It is difficult to propound any scientific method to
measure network performance. It is not only the transport layer where performance
issues arise but it also includes network layer related to routing and congestion control. Notes
Based on experiences and examples, some rules of thumb have been proposed. They
are:
Performance problems in computer networks: Congestion is the one example of
such types of problems when more traffic suddenly arrives at a router than the router
can handle, it creates problem of overloads and leads to congestion to force the
performance deteriorate. The performance also degrades when there is a resource
imbalance. For example, when a high speed line is connected to a low end computer,
the performance will certainly degrades. Other factors of computer networks
responsible for degradation of the performance are broadcast storm of error messages
due to some bad parameters in TPDU, collapsing of RARP server when several
machines try to learn their true identity from a RARP server in case of power restoration
and booting of all machines together, setting of time-outs incorrectly, bandwidth-delay
product, etc.
Measuring network performance: It includes measuring of the relevant network
parameters and performance, understanding the bottleneck and reasons for it and
changing of some parameters. The most basic kind of measurement is to start a timer
at the beginning of some activity to see how long it takes, e.g. round trip time. Other
measurements are made with counters to record how often some event has happened,
e.g. number of lost TPDU’s. Finally, one is often interested in knowing the amount of
something, e.g. the number of bytes processed in a given time interval. To carry out the
measuring of network performance, it should be ensured that the sample size is large
enough; samples are representative that is there are no congestions at lunch time;
nothing unexpected is going on during the tests, etc.
System design for better performance: The network performance could be improved
considerably with the help of measuring and tuning. However, they are not substitute for
good design. System design is dependent not just on network design that includes
routers, interface boards, etc, but also on the software and operating system. Improved
CPU speed is one of the factors that enable getting the bits from the user’s buffer out on
the transmission media fast enough and having the receiving CPU process them as fast
as they come in. Reduced packet count to reduce software overhead to improve
processor’s performance, minimized context switches, minimized copying for an
incoming packet, etc are also important factors for design.
Fast TPDU processing: It separates out the normal case (data transfer in the
ESTABLISHED state, no PSH or URG, enough window space) and handles it
separately. Timer management is also optimized for the case of timers rarely expiring.
Protocols for gigabit networks: Some of the problems associated with it are
mentioned. The communication speeds have been improving much faster than
computing speeds and at a rate of 1 Gbps, use of 16 or 32 bit sequence numbers takes
only 32 sec to send 232 bytes and in the Internet packets live for 120 sec. The go back
n protocol works poorly on lines with a large bandwidth-delay product. The gigabit lines
are different from megabit lines. In the multimedia applications jitter in packet arrival
time is as important as the mean delay itself. However, old protocols were often
designed to minimize the number of bits on in the transmission media, frequently by
using small fields and packing them together into bytes and words. Therefore, with
gigabit networks, the protocol processing is the problem instead of the bandwidth.
Hence, protocols need to be designed to minimize it.
8.6 Summary
The transport layer responds to service requests from the session layer and issue
service requests to the network layer. Transport layer bridges the gap of the services
provided by the network and therefore enhances the quality of service provided to the
users. Transport Service Primitives are used to access transport services by the
Notes
8. A _____ is a TCP name for a transport service access point.
a) port
b) pipe
c) node
d) none of the mentioned
1. a) network layer