Unit IV Course Material Comp - Networks
Unit IV Course Material Comp - Networks
MAC sub layer for Standard Ethernet, Fast Ethernet, Wireless LAN and broadband
wireless. Design issues of network layer - Routing algorithm - shortest path routing -
Distance vector routing - Broadcast routing –Inter domain routing, Congestion control
algorithm - Congestion control in virtual circuit and datagram switches - The network layer
in the internet - The IP protocol-IP Addresses - IPv6, ARP,DHCP,ICMP, Classless
Addressing, Network Address Translation.
Ethernet operates in the data link layer and the physical layer. It is a family of
networking technologies that are defined in the IEEE 802.2 and 802.3 standards. Ethernet
supports data bandwidths of
➢ 10 Mb/s
➢ 100 Mb/s
➢ 1000 Mb/s (1 Gb/s)
➢ 10,000 Mb/s (10 Gb/s)
➢ 40,000 Mb/s (40 Gb/s)
➢ 100,000 Mb/s (100 Gb/s)
Ethernet standards define both the Layer 2 protocols and the Layer 1 technologies.
For the Layer 2 protocols, as with all 802 IEEE standards, Ethernet relies on the two
separate sublayers of the data link layer to operate, the Logical Link Control (LLC) and
the MAC sublayers.
LLC sublayer
The Ethernet LLC sublayer handles the communication between the upper layers
and the lower layers. This is typically between the networking software and the device
hardware. The LLC sublayer takes the network protocol data, which is typically an IPv4
packet, and adds control information to help deliver the packet to the destination node.
The LLC is used to communicate with the upper layers of the application, and transition
the packet to the lower layers for delivery.
LLC is implemented in software, and its implementation is independent of the
hardware. In a computer, the LLC can be considered the driver software for the NIC. The
NIC driver is a program that interacts directly with the hardware on the NIC to pass the
data between the MAC sublayer and the physical media.
MAC sublayer
MAC constitutes the lower sublayer of the data link layer. MAC is implemented by
hardware, typically in the computer NIC. The specifics are specified in the IEEE 802.3
standards. Figure 4.1 lists common IEEE Ethernet standards.
Fast Ethernet is a collective term for a number of Ethernet standards that carry
traffic at the nominal rate of 100 Mbit/s (the earlier Ethernet speed was 10 Mbit/s). Of the
Fast Ethernet standards, 100BASE-TX is by far the most common.
Fast Ethernet was introduced in 1995 as the IEEE 802.3u standard and remained
the fastest version of Ethernet for three years before the introduction of Gigabit Ethernet.
A wireless local area network (WLAN) is a wireless computer network that links two
or more devices using wireless communication within a limited area such as a home,
school, computer laboratory, or office building. This gives users the ability to move around
within a local coverage area and yet still be connected to the network. Through a
gateway, a WLAN can also provide a connection to the wider Internet.
Most modern WLANs are based on IEEE 802.11 standards and are marketed under
the Wi-Fi brand name.
i) Host transmits packet to router across LAN or oval point to point link.
ii) Packet is stored on router until fully arrived and processed.
iii) Packet is forward to next router.
2) Service provide to transport layer :
The network layer services have been designed with the goals : -
Connectionless service is offered packets are injected into the subnet individually
and routed independently of each other. Each packet is transmitted independently.
Connectionless service used in network layer ID and transport layer.
Packet are frequently called datagram connectionless service is largely for data
communication the internet.
Fairness and optimality may sound obvious, but as it turns out, they are often
contradictory goals. There is enough traffic between A and A', between B and B', and
between C and C' to saturate the horizontal links. To maximize the total flow, the X to X'
traffic should be shut off altogether. Unfortunately, X and X' may not see it that way.
Evidently, some compromise between global efficiency and fairness to individual
connections is needed.
CATEGORY OF ALGORITHM
➢ Routing algorithms can be grouped into two major classes: nonadaptive and
adaptive.
➢ Nonadaptive algorithms do not base their routing decisions on measurements or
estimates of the current traffic and topology. Instead, the choice of the route to use to
get from I to J is computed in advance, off-line, and downloaded to the routers when
the network is booted.
➢ This procedure is sometimes called Static routing.
➢ Adaptive algorithms, in contrast, change their routing decisions to reflect changes in
the topology, and usually the traffic as well
➢ This procedure is sometimes called dynamic routing
➢ If router J is on the optimal path from router I to router K, then the optimal path from J
to K also falls along the same route.
➢ The set of optimal routes from all sources to a given destination form a tree rooted at
the destination. Such a tree is called a sink tree.
➢ As a direct consequence of the optimality principle, we can see that the set of optimal
routes from all sources to a given destination form a tree rooted at the destination.
➢ Such a tree is called a sink tree where the distance metric is the number of hops. Note
that a sink tree is not necessarily unique; other trees with the same path lengths may
exist.
➢ The goal of all routing algorithms is to discover and use the sink trees for all routers.
Fig 4.2 (a) A Sub Net, (b) A Sink tree for Router B
➢ A technique to study routing algorithms: The idea is to build a graph of the subnet, with
each node of the graph representing a router and each arc of the graph representing
a communication line (often called a link).
➢ To choose a route between a given pair of routers, the algorithm just finds the shortest
path between them on the graph.
➢ One way of measuring path length is the number of hops. Another metric is the
geographic distance in kilometers. Many other metrics are also possible. For example,
each arc could be labeled with the mean queuing and transmission delay for some
standard test packet as determined by hourly test runs.
➢ In the general case, the labels on the arcs could be computed as a function of the
distance, bandwidth, average traffic, communication cost, mean queue length,
measured delay, and other factors. By changing the weighting function, the algorithm
would then compute the ''shortest'' path measured according to any one of a number
of criteria or to a combination of criteria.
Figure 4.3 The first five steps used in computing the shortest path from A to D. The
arrows indicate the working node.
➢ To illustrate how the labelling algorithm works, look at the weighted, undirected graph
of Fig. 4.3 (a), where the weights represent, for example, distance.
➢ We want to find the shortest path from A to D. We start out by marking node A as
permanent, indicated by a filled-in circle.
➢ Then we examine, in turn, each of the nodes adjacent to A (the working node),
relabeling each one with the distance to A.
➢ Whenever a node is relabelled, we also label it with the node from which the probe
was made so that we can reconstruct the final path later.
➢ Having examined each of the nodes adjacent to A, we examine all the tentatively
labelled nodes in the whole graph and make the one with the smallest label permanent,
as shown in Fig. 4.3 (b).
➢ This one becomes the new working node.
We now start at B and examine all nodes adjacent to it. If the sum of the label on B
and the distance from B to the node being considered is less than the label on that node,
we have a shorter path, so the node is relabeled
After all the nodes adjacent to the working node have been inspected and the
tentative labels changed if possible, the entire graph is searched for the tentatively-
labelled node with the smallest value. This node is made permanent and becomes the
working node for the next round. Figure 4.3 shows the first five steps of the algorithm.
Another example using Dijkstra's algorithm to compute the shortest paths from a
given source node to all other nodes in a network. Links are bi-directional, with the same
distance in either direction. Distance can be any measure of cost.
Example with 8 nodes and 11 links
nodeset = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'}
linklist = [('A', 'B', 2), ('B', 'C', 7), ('C', 'D', 3),
# (node,node,distance) ('B', 'E', 2), ('E', 'F', 2), ('F', 'C', 3), ('A', 'G', 6), ('G', 'E', 1),
('G', 'H', 4), ('F', 'H', 2), ('H', 'D', 2),
The strategy is to start at the source node, send probes to each of its adjacent
nodes, pick the node with the shortest path from the source, and make that the new
working node. Send probes from the new working node, pick the next shortest path, and
make that the next working node. Continue selecting the shortest possible path until every
every node in the network has been selected.
Figure 4.4 shows the first few steps in our example network. Labels on each node
show its distance from the source, and the previous node on the path from which that
distance was computed.
As new nodes are first probed, they are added to a working set, shown with a
darkened open circle. After each probe cycle, we look at the entire set of working nodes.
The node with the shortest path is moved to a final set, shown with a solid circle.
The light dotted lines are links not used in any shortest path from node A. They
might be used in another tree, however. Each node in a network can compute its own
shortest path tree, given the linklist for the entire network.
FLOODING
• Another static algorithm is flooding, in which every incoming packet is sent out on
every outgoing line except the one it arrived on.
• Flooding obviously generates vast numbers of duplicate packets, in fact, an infinite
number unless some measures are taken to damp the process.
• One such measure is to have a hop counter contained in the header of each
packet, which is decremented at each hop, with the packet being discarded when the
counter reaches zero.
• Ideally, the hop counter should be initialized to the length of the path from source
to destination. If the sender does not know how long the path is, it can initialize the counter
to the worst case, namely, the full diameter of the subnet.
Distance vector routing algorithms operate by having each router maintain a table
(i.e, a vector) giving the best known distance to each destination and which line to use to
get there.
These tables are updated by exchanging information with the neighbors.
The distance vector routing algorithm is sometimes called by other names, most
commonly the distributed Bellman-Ford routing algorithm and the Ford-Fulkerson
algorithm, after the researchers who developed it (Bellman, 1957; and Ford and
Fulkerson, 1962).
It was the original ARPANET routing algorithm and was also used in the Internet
under the name RIP.
Figure 4.5 (a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.
Part (a) shows a subnet. The first four columns of part (b) show the delay vectors
received from the neighbours of router J.
A claims to have a 12-msec delay to B, a 25-msec delay to C, a 40-msec delay to
D, etc. Suppose that J has measured or estimated its delay to its neighbours, A, I, H,
and K as 8, 10, 12, and 6 msec, respectively.
1. The starting assumption for distance-vector routing is that each node knows the
cost of the link to each of its directly connected neighbors.
2. A link that is down is assigned an infinite cost.
Example.
A 0 1 1 � 1 1 �
B 1 0 1 � � � �
C 1 1 0 1 � � �
D � � 1 0 � � 1
E 1 � � � 0 � �
F 1 � � � � 0 1
G � � � 1 � 1 0
Table 1. Initial distances stored at each node (global view)
We can represent each node's knowledge about the distances to all other nodes as a
table like the one given in Table 1.
Note that each node only knows the information in one row of the table.
1. Every node sends a message to its directly connected neighbors containing its
personal list of distance. ( for example, A sends its information to its neighbors
B,C,E, and F. )
2. If any of the recipients of the information from A find that A is advertising a path
shorter than the one they currently know about, they update their list to give the new
path length and note that they should send packets for that destination through A.
(node B learns from A that node E can be reached at a cost of 1; B also knows it
can reach A at a cost of 1, so it adds these to get the cost of reaching E by means
of A. B records that it can reach E at a cost of 2 by going through A.)
3. After every node has exchanged a few updates with its directly connected
neighbors, all nodes will know the least-cost path to all the other nodes.
4. In addition to updating their list of distances when they receive updates, the nodes
need to keep track of which node told them about the path that they used to calculate
the cost, so that they can create their forwarding table. ( for example, B knows that
it was A who said " I can reach E in one hop" and so B puts an entry in its table that
says " To reach E, use the link to A.)
Distance to Reach Node
Information
Stored at Node
A B C D E F G
A 0 1 1 2 1 1 2
B 1 0 1 2 2 2 3
C 1 1 0 1 2 2 2
D 2 2 1 0 3 2 1
E 1 2 2 3 0 2 3
F 1 2 2 2 2 0 1
G 2 3 2 1 3 1 0
Table 2. final distances stored at each node ( global view).
In practice, each node's forwarding table consists of a set of triples of the form:
(Destination, Cost, Next Hop).
For example, Table 3 shows the complete routing table maintained at node B for the
network in figure 4.3.
A 1 A
C 1 C
D 2 C
E 2 A
F 2 A
G 3 A
Figure 4.7 Reverse path forwarding. (a) A subnet. (b) A sink tree. (c) The tree built by
reverse path forwarding.
Part (a) shows a subnet, part (b) shows a sink tree for router I of that subnet, and part (c)
shows how the reverse path algorithm works.
• When a broadcast packet arrives at a router, the router checks to see if the packet
arrived on the line that is normally used for sending packets to the source of the
broadcast. If so, there is an excellent chance that the broadcast packet itself followed the
best route from the router and is therefore the first copy to arrive at the router.
• This being the case, the router forwards copies of it onto all lines except the one it
arrived on. If, however, the broadcast packet arrived on a line other than the preferred
one for reaching the source, the packet is discarded as a likely duplicate.
4.9 Congestion control algorithms
When too many packets are present in (a part of) the subnet, performance degrades.
This situation is called congestion.
• Figure 4.8 depicts the symptom. When the number of packets dumped into the subnet
by the hosts is within its carrying capacity, they are all delivered (except for a few that are
afflicted with transmission errors) and the number delivered is proportional to the number
sent.
• However, as traffic increases too far, the routers are no longer able to cope and they
begin losing packets. This tends to make matters worse. At very high traffic, performance
collapses completely and almost no packets are delivered.
Figure 4.8. When too much traffic is offered, congestion sets in and performance
degrades sharply.
• Many problems in complex systems, such as computer networks, can be viewed from
a control theory point of view. This approach leads to dividing all solutions into two
groups: open loop and closed loop. Open loop solutions attempt to solve the problem
by good design.
• Tools for doing open-loop control include deciding when to accept new traffic, deciding
when to discard packets and which ones, and making scheduling decisions at various
points in the network.
• Closed loop solutions are based on the concept of a feedback loop.
• This approach has three parts when applied to congestion control: 1. Monitor the
system to detect when and where congestion occurs. 2. Pass this information to places
where action can be taken. 3. Adjust system operation to correct the problem.
• A variety of metrics can be used to monitor the subnet for congestion. Chief among
these are the percentage of all packets discarded for lack of buffer space, the average
queue lengths, the number of packets that time out and are retransmitted, the average
packet delay, and the standard deviation of packet delay. In all cases, rising numbers
indicate growing congestion.
• The second step in the feedback loop is to transfer the information about the
congestion from the point where it is detected to the point where something can be
done about it. In all feedback schemes, the hope is that knowledge of congestion will
cause the hosts to take appropriate action to reduce the congestion.
• The presence of congestion means that the load is (temporarily) greater than the
resources (in part of the system) can handle. Two solutions come to mind: increase
the resources or decrease the load.
Similarly, each network interface contains a leaky bucket and the following steps are
involved in leaky bucket algorithm:
1. When host wants to send packet, packet is thrown into the bucket.
2. The bucket leaks at a constant rate, meaning the network interface transmits
packets at a constant rate.
3. Bursty traffic is converted to a uniform traffic by the leaky bucket.
4. In practice the bucket is a finite queue that outputs at a finite rate.
Need of token bucket Algorithm:- The leaky bucket algorithm enforces output
pattern at the average rate, no matter how bursty the traffic is. So in order to deal
with the bursty traffic we need a flexible algorithm so that the data is not lost. One
such algorithm is token bucket algorithm.
The transport layer enables the applications to efficiently and reliably exchange
data. Transport layer entities expect to be able to send segment to any destination without
having to understand anything about the underlying subnetwork technologies. Many
subnetwork technologies exist. Most of them differ in subtle details (frame size,
addressing, ...). The network layer is the glue between these subnetworks and the
transport layer. It hides to the transport layer all the complexity of the underlying
subnetworks and ensures that information can be exchanged between hosts connected
to different types of subnetworks.
Principles :
The main objective of the network layer in is to allow end systems, connected to
different networks, to exchange information through intermediate systems called router.
The unit of information in the network layer is called a packet.
The TCP/IP model is an alternative model of how the Internet works. It divides the
processes involved into four layers instead of seven. Some would argue that the TCP/IP
model better reflects the way the Internet functions today, but the OSI model is still widely
referenced for understanding the Internet, and both models have their strengths and
weaknesses.
The Internet designers were unsure whether the world would evolve into a few networks
with many hosts (e.g., large networks), or many networks each supporting only a few
hosts (e.g., small networks). Thus, Internet addresses handle both large and small
networks. Internet address are four bytes in size, where:
1. Class A addresses start with a ``0'' in the most significant bit, followed by a 7-bit
network address and a 24-bit local part.
2. Class B addresses start with a ``10'' in the two most significant bits, followed by a
14-bit network number and a 16-bit local part.
3. Class C addresses start with a ``110'' in the three most significant bits, followed by
a 22-bit network number and an 8-bit local part.
4. Class D addresses start with a ``1110'' in the four most significant bits, followed by
a 28-bit group number.
Note: The use of fixed-sized addresses makes the routing operation efficient. In the ISO
world, addresses are of varying format and length and just extracting the address from
the packet may not be straightforward.
Internet addresses can also refer to broadcast addresses. The all 1's address is used to
mean ``broadcast on this network''. Of course, if the underlying network technology
doesn't support broadcasting, one can't broadcast Internet datagrams either.
Network addresses are written using dotted decimal notation. Each address consists of
4 bytes, and each byte is written in decimal form. Sample addresses:
Note: Internet addresses refer to network connections rather than hosts. Gateways, for
instance, have two or more network connections and each interface has its own IP
address. Thus, there is not a one-to-one mapping between host names and IP addresses.
4.11 IPv6
IPv6 is the replacement Internet protocol for IPv4. It corrects some of the
deficiencies of IPv4 and simplifies the way that addresses are configured and how they
are handled by Internet hosts. IPv4 has proven to be robust, easily implemented, and
interoperable, and has stood the test of scaling an internetwork to a global utility the size
of the Internet. However, the initial design did not anticipate the following conditions:
• Recent exponential growth of the Internet and the impending exhaustion of the
IPv4 address space
• The ability of Internet backbone routers to maintain large routing tables
• Need for simpler auto configuration and renumbering
• Requirement for security at the IP level (IPSec)
• Need for better support for real-time delivery of data, known as quality of service
(QoS)
IPv6 Simplifications
Fixed format headers – Use extension headers instead of options
• Remove header checksum – Rely on link layer and higher layers to check integrity
of data
• Remove hop-by-hop segmentation – Fragmentation only by sender due to path
MTU discovery
Fixed Header
An IPv6 address is 4 times larger than IPv4, but surprisingly, the header of an IPv6
address is only 2 times larger than that of IPv4. IPv6 headers have one Fixed Header and
zero or more Optional (Extension) Headers. All the necessary information that is essential
for a router is kept in the Fixed Header. The Extension Header contains optional
information that helps routers to understand how to handle a packet/flow.
Extension Headers
In IPv6, the Fixed Header contains only that much information which is necessary,
avoiding those information which is either not required or is rarely used. All such
information is put between the Fixed Header and the Upper layer header in the form of
Extension Headers. Each Extension Header is identified by a distinct value.
When Extension Headers are used, IPv6 Fixed Header’s Next Header field points
to the first Extension Header. If there is one more Extension Header, then the first
Extension Header’s ‘Next-Header’ field points to the second one, and so on. The last
Extension Header’s ‘Next-Header’ field points to the Upper Layer Header. Thus, all the
headers points to the next one in a linked list manner.
If the Next Header field contains the value 59, it indicates that there are no headers
after this header, not even Upper Layer Header.
The following Extension Headers must be supported as per RFC 2460:
The address resolution protocol (ARP) uses a basic message format that contains either
address resolution request or address resolution response. The ARP message size
depends on the address size of the link layer and the network layer. The message header
describes the network type used at each layer and the address size of each layer. The
message header is complete with the help of the operation code, which
is 1 for request and 2 for the response. The payload of the packet has four addresses,
these are:
PTYPE (Protocol Type) - The protocol type is a 16-bit field used to specify the type of
protocol.
HLEN (Hardware Length) - The size of the hardware length field is 8-bit. This field
specifies the length of the physical address in bytes.
PLEN (Protocol Length) - The size of the protocol length field is 8-bit long. It defines the
length of the IP address in bytes.
OPER (Operation) - It is a 16-bit field that determines the type of ARP packet. There are
two types of ARP packets, i.e., ARP request and ARP Reply. In the given table, the first
two values are used for the ARP request and reply. The values for the other ARP frame
format such as RARP, DRARP, etc. are also specified in this table.
SPA (Sender Protocol Address) - This field is used to determine the logical address of
the sender, and the length of this field is not fixed.
THA (Target Hardware Address) - The target hardware address specifies the physical
address of the target. It is a variable-length field. For the ARP request packet, this field
contains all zeros because the sender does not know the physical address of the receiver.
TPA (Target Protocol Address) - This field determines the logical address of the
target. TPA is a variable-length field.
CIDR allows routers to group together to reduce the bulk of routing information
carried by the core routers. With CIDR, IP addresses and their subnet masks are
written as four octets, separated by periods, followed by a forward slash and a two-
digit number that represents the subnet mask e.g. 10.1.1.0/30, 172.16.1.16/28 and
192.168.1.32/27 etc.
With the introduction of CIDR and VLSM, ISPs could now assign one part of a
classful network to one customer and different part to another customer. With the
introduction of VLSM and CIDR, network administrators had to use additional
subnetting skills.
4.15 Network Address Translation (NAT)
To access the Internet, one public IP address is needed, but we can use a private
IP address in our private network. The idea of NAT is to allow multiple devices to access
the Internet through a single public address. To achieve this, the translation of a private
IP address to a public IP address is required. Network Address Translation (NAT) is
a process in which one or more local IP address is translated into one or more Global
IP address and vice versa in order to provide Internet access to the local hosts. Also, it
does the translation of port numbers i.e. masks the port number of the host with another
port number, in the packet that will be routed to the destination. It then makes the
corresponding entries of IP address and port number in the NAT table. NAT generally
operates on a router or firewall.
Generally, the border router is configured for NAT i.e the router which has one
interface in the local (inside) network and one interface in the global (outside) network.
When a packet traverse outside the local (inside) network, then NAT converts that local
(private) IP address to a global (public) IP address. When a packet enters the local
network, the global (public) IP address is converted to a local (private) IP address. If
NAT runs out of addresses, i.e., no address is left in the pool configured then the packets
will be dropped and an Internet Control Message Protocol (ICMP) host unreachable
packet to the destination is sent.
Suppose, in a network, two hosts A and B are connected. Now, both of them
request for the same destination, on the same port number, say 1000, on the host side,
at the same time. If NAT does only translation of IP addresses, then when their packets
will arrive at the NAT, both of their IP addresses would be masked by the public IP
address of the network and sent to the destination. Destination will send replies to the
public IP address of the router. Thus, on receiving a reply, it will be unclear to NAT as
to which reply belongs to which host (because source port numbers for both A and B
are the same). Hence, to avoid such a problem, NAT masks the source port number as
well and makes an entry in the NAT table.
Inside refers to the addresses which must be translated. Outside refers to the
addresses which are not in control of an organization. These are the network Addresses
in which the translation of the addresses will be done.
• Inside local address – An IP address that is assigned to a host on the Inside (local)
network. The address is probably not an IP address assigned by the service provider
i.e., these are private IP addresses. This is the inside host seen from the inside
network.
• Inside global address – IP address that represents one or more inside local IP
addresses to the outside world. This is the inside host as seen from the outside
network.
• Outside local address – This is the actual IP address of the destination host in the
local network after translation.
• Outside global address – This is the outside host as seen from the outside network.
It is the IP address of the outside destination host before translation.
Network Address Translation (NAT) Types – There are 3 ways to configure NAT:
3. Port Address Translation (PAT) – This is also known as NAT overload. In this,
many local (private) IP addresses can be translated to a single registered IP address.
Port numbers are used to distinguish the traffic i.e., which traffic belongs to which IP
address. This is most frequently used as it is cost-effective as thousands of users
can be connected to the Internet by using only one real global (public) IP address.
Advantages of NAT –
Disadvantage of NAT –