DC Unit-3
DC Unit-3
Syllabus:
The Network Layer: Introduction, Forwarding and Routing, Network Service Models, Virtual
Circuit and Datagram Networks-Virtual-Circuit Networks, Datagram Networks, Origins of
VC and Datagram Networks, Inside a Router-Input Processing, Switching, Output
Processing, Queuing, The Routing Control Plane, The Internet Protocol(IP):Forwarding and
Addressing in the Internet- Datagram format, Ipv4 Addressing, Internet Control Message
Protocol(ICMP), IPv6
ISP’s equipment
The major components of the system are the carrier's equipment (routers connected by
transmission lines), shown inside the shaded oval, and the customers' equipment, shown
outside the oval. Host H1 is directly connected to one of the carrier's routers, A, by a leased
line. In contrast, H2 is on a LAN with a router, F, owned and operated by the customer.
This equipment is used as follows. A host with a packet to send transmits it to the nearest
router, either on its own LAN or over a point-to-point link to the carrier. The packet is stored
there until it has fully arrived so the checksum can be verified. Then it is forwarded to the
next router along the path until it reaches the destination host, where it is delivered. This
mechanism is store-and-forward packet switching.
Network Service Models:
Services Provided to the Transport Layer:
The network layer provides services to the transport layer at the network
layer/transport layer interface. The network layer services have been designed with the
following goals in mind.
1. The services should be independent of the router technology.
2. The transport layer should be shielded from the number, type, and topology of the
routers present.
3. The network addresses made available to the transport layer should use a uniform
numbering plan, even across LANs and WANs.
The network service should be connectionless, with primitives SEND PACKET and
RECEIVE PACKET and little else. In particular, no packet ordering and flow control
should be done, because the hosts are going to do that anyway, and there is usually little
to be gained by doing it twice. Furthermore, each packet must carry the full destination
address, because each packet sent is carried independently of its predecessors, if any.
4.1.3 Implementation of Connectionless Service:
In connectionless service, packets are injected into the subnet individually and routed
independently of each other. No advance setup is needed. In this context, the packets are
frequently called datagrams and the subnet is called a datagram subnet.
Let us now see how a datagram subnet works,
A’s table (initially) A’s table (later) C’s Table E’s Table
The process P1 on host H1 has a long message for P2 on host H2. The network layer has
to break a message into four packets, 1, 2, 3, and 4 and sends each of them in turn to
router A. A has only two outgoing lines to B and C so every incoming packet must be
sent to one of these routers, even if the ultimate destination is some other router. A's
initial routing table is shown in the figure under the label ''initially.''
As they arrived at A, packets 1, 2, and 3 were stored briefly (to verify their checksums).
Then each was forwarded to C according to A's table. Packet 1 was then forwarded to E
and then to F. When it got to F, it was encapsulated in a data link layer frame and sent
to H2 over the LAN. Packets 2 and 3 follow the same route.
However, something different happened to packet 4. When it got to A it was sent to
router B, even though it is also destined for F. For some reason, perhaps it learned of a
traffic jam
algorithm that manages the tables and makes the routing decisions is called the routing
algorithm.
4.1.4 Implementation of Connection-Oriented Service:
In connection-oriented service, a path from the source router to the destination router
must be established before any data packets can be sent. This connection is called a VC
(virtual circuit), and the subnet is called a virtual-circuit subnet.
The idea behind virtual circuits is to avoid having to choose a new route for every
packet sent. Instead, when a connection is established, a route from the source machine
to the destination machine is chosen as part of the connection setup and stored in tables
inside the routers.
Here, host H1 has established connection 1 with host H2. It is remembered as the first
entry in each of the routing tables. The first line of A's table says that if a packet
bearing connection identifier 1 comes in from H1, it is to be sent to router C and given
connection identifier 1. Similarly, the first entry at C routes the packet to E, also with
connection identifier 1. Similarly if H3 wants to connect to H2 they have to do the same
procedure and it has to use different connection identifier in above example host H3
uses connection identifier as one.
Virtual Circuit and Datagram Networks-Virtual-Circuit Networks, Datagram
Networks :
these may vary in a virtual circuit service due to factors such as:
1. X.25:
2. Interface between Data Terminal Equipment (DTE) and Data Circuit-
terminating Equipment (DCE) for terminals operating in the packet mode and
connected to public data networks by dedicated circuit.
2 Frame Relay:.
Frame Relay is a standardized wide area network (WAN) technology that
specifies the physical and data link layers of digital telecommunications channels
using a packet switching methodology.
Datagrams:
Datagrams are data packets which contain adequate header information so that
they can be individually routed by all intermediate network switching devices to
the destination. These networks are called datagram networks.
Features of Datagram Networks
The following diagram shows datagram packets being send by host H1 to host H2. The four
datagram packets labelled as A, B, C and D, all belonging to same message are being routed
separately via separate routes. The packets in the message arrives in the destination out of
order. It is the responsibility of H2 to reorder the packets in order to retrieve the original
message.
Origins of VC and Datagram Networks:
The evolution of datagram and virtual circuit networks reflects their origins. The notion
of a virtual circuit as a central organizing principle has its roots in the telephony world,
which uses real circuits. With call setup and per-call state being maintained at the
routers within the network, a VC network is arguably more complex than a datagram
network.
This, too, is in keeping with its telephony heritage. Telephone networks, by necessity,
had their complexity within the network, since they were connecting dumb end-system
devices such as rotary telephones. (For those too young to know, a rotary phone is an
analog telephone with no buttons—only a dial.)
The Internet as a datagram network, on the other hand, grew out of the need to connect
computers together. Given more sophisticated end-system devices, the Internet
architects chose to make the network-layer service model as simple as possible.
Additional functionality (for example, in-order delivery, reliable data transfer,
congestion control, and DNS name resolution) is then implemented at a higher layer, in
the end systems.
This inverts the model of the telephone network, with some interesting consequences:
• Since the resulting Internet network-layer service model makes minimal (no!) service
guarantees, it imposes minimal requirements on the network layer.
This makes it easier to interconnect networks that use very different link-layer
technologies (for example, satellite, Ethernet, fiber, or radio) that have very different
transmission rates and loss characteristics.
• Applications such as e-mail, the Web, and even some network infrastructure services
such as the DNS are implemented in hosts (servers) at the network edge.
The ability to add a new service simply by attaching a host to the network and defining
a new application-layer protocol (such as HTTP) has allowed new Internet applications
such as the Web to be deployed in a remarkably short period of time.
In a WiFi router, the input is the data that the router receives from the internet service
provider (ISP) or from other devices connected to it, while the output is the data that
the router sends out to the connected devices or to the internet.
Input ports. The input port performs several functions. It performs the
physical layer It performs the data link layer functionality needed to
interoperate with the data link layer functionality on the other side of the
incoming link. It also performs a lookup and forwarding function so that a
datagram forwarded into the switching fabric of the router emerges at the
appropriate output port.
Switching fabric. The switching fabric connects the router's input ports to
its output ports. This switching fabric is completely contained with the
router - a network inside of a network router!
Output ports. An output port stores the datagrams that have been forwarded
to it through the switching fabric, and then transmits the datagrams on the
outgoing link. The output port thus performs the reverse data link and
physical layer functionality as the input port.
Routing processor. The routing processor executes the routing protocols
maintains the routing tables, and performs network management functions
within the router
1.Input Port: This is the interface by which packets are admitted into the router,
Commonly used queue disciplines are: FIFO - Customers are served on a first-in first-out
basis. LIFO - Customers are served in a last-in first-out manner.
Multicast routing may require an additional routing table for multicast routes. Several
routing protocols e.g. IS-IS, OSPF and BGP maintain internal databases of candidate
routes which are promoted when a route fails or when a routing policy is changed.
The Version field keeps track of which version of the protocol the datagram belongs to.
• The header length is not constant, a field in the header, IHL, is provided to tell how long the
header is, in 32-bit words.
• The Type of service field is one of the few fields that have changed its meaning (slightly)
over the years. It was and is still intended to distinguish between different classes of service.
•The Total length includeseverything inthe datagram—both header and data. Themaximum
length is65,535 bytes.
•The Identification field isneeded to allowthe destination host to determinewhichdatagrama
newlyarrivedfragment belongsto. All the fragments of a datagramcontain the
sameIdentification value. Next comes an unused bit and then two 1-bit fields.
•DFstands for Don't Fragment.It is an ordertothe routersnot to fragment
thedatagrambecausethe destination is incapable of puttingthepieces back togetheragain.
•MFstands for More Fragments. All fragments except the last onehave this bit set.It is needed
to know when all fragments of a datagram have arrived.
•The Fragment offset tells where in the currentdatagram this fragmentbelongs.All fragments
except thelast one in a datagram mustbe a multiple of 8bytes, theelementary fragmentunit.
Since13 bits are provided, there is a maximumof 8192 fragmentsper datagram, giving a
maximum datagram length of 65,536 bytes, onemore than theTotal length field.
•The Time to live field isa counter used to limit packet lifetimes. It is supposedtocount time in
seconds, allowing a maximum lifetime of 255 sec.
•When the network layer has assembled a completedatagram, it needs to knowwhat to do
with it. TheProtocolfield tells it which transport processto give it to.TCP is onepossibility,but
so are UDP and some others. Thenumberingof protocols is global across the entire Internet.
•TheHeaderchecksumverifiestheheaderonly.
•The Source addressand Destination addressindicate thenetwork number andhost number.
•The Optionsfield was designed to providean escape to allow subsequent versionsof the
protocol to includeinformationnot present in theoriginal design,to permitexperimentersto try
outnewideas,and to avoid allocating headerbits toinformationthat is rarelyneeded.
•Theoptionsarevariablelength.
IPAddress :
IP addresses were divided into the five categorieslisted in Fig. This allocation has come to
becalled classful addressing.Itisno longer used, but references to it in the literature are
stillcommon.
The class A, B, C, and D formats allow for up to 128 networks with 16 million hosts each,
16,384 networks with up to 64K hosts, and 2 million networks (e.g., LANs) with up to 256
hosts each (although a few of these are special). Also supported is multicast, in which a
datagram is directed to multiple hosts. Addresses beginning with 1111 are reserved for future
use.
Network addresses, which are 32-bit numbers, are usually written in dotted decimal notation.
In this format, each of the 4 bytes is written in decimal, from 0 to 255. For example, the 32-
bit hexadecimal address C0290614 is written as 192.41.6.20. The lowest IP address is 0.0.0.0
and the highest is 255.255.255.255.
Subnets:
As we have seen, all the hosts in a network must have the same network number. This
property of IP addressing can cause problems as networks grow. The solution is to allow a
network to be split into several parts for internal use but still act like a single network to the
outside world.
In the Internet literature, the parts of the network (in this case, Ethernets) are called subnets.
To implement subnetting, the main router needs a subnet mask that indicates the split
between network + subnet number and host, as shown in Fig. Subnet masks are also written
in dotted decimal notation, with the addition of a slash followed by the number of bits in the
network + subnet part. For the example of Fig. the subnet mask can be written as
255.255.252.0. An alternative notation is /22 to indicate that the subnet mask is 22 bits long.
the IP address and varies depending on the number of bits needed, rather than any arbitrary class
assignment structure. A destination IP address or route that describes many possible destinations
has a shorter prefix and is said to be less specific.
Ipv4 Addressing:
In this mode, data is sent only to one destined host. The Destination Address field contains
32- bit IP address of the destination host. Here the client sends data to the targeted server −
In this mode, the packet is addressed to all the hosts in a network segment. The Destination
Address field contains a special broadcast address, i.e. 255.255.255.255. When a host sees
this packet on the network, it is bound to process it. Here the client sends a packet, which is
entertained by all the Servers −
Multicast Addressing Mode
This mode is a mix of the previous two modes, i.e. the packet sent is neither destined to a
single host nor all the hosts on the segment. In this packet, the Destination Address contains a
special address which starts with 224.x.x.x and can be entertained by more than one host.
Here a server sends packets which are entertained by more than one servers. Every network
has one IP address reserved for the Network Number which represents the network and one
IP address reserved for the Broadcast Address, which represents all the hosts in that network.
A single IP address can contain information about the network and its sub-network and
ultimately the host. This scheme enables the IP Address to be hierarchical where a network
can have many sub-networks which in turn can have many hosts.
Subnet Mask
The 32-bit IP address contains information about the host and its network. It is very necessary
to distinguish both. For this, routers use Subnet Mask, which is as long as the size of the
network address in the IP address. Subnet Mask is also 32 bits long. If the IP address in
binary is ANDed with its Subnet Mask, the result yields the Network address. For example,
say the IP Address is 192.168.1.152 and the Subnet Mask is 255.255.255.0 then −
This way the Subnet Mask helps extract the Network ID and the Host from an IP Address. It
can be identified now that 192.168.1.0 is the Network number and 192.168.1.152 is the host
on that network.
In the ICMP packet format, the first 32 bits of the packet contain three fields:
Type (8-bit): The initial 8-bit of the packet is for message type, it provides a brief
description of the message so that receiving network would know what kind of message it
is receiving and how to respond to it. Some common message types are as follows:
Type 0 – Echo reply
Type 3 – Destination unreachable
Type 5 – Redirect Message
Type 8 – Echo Request
Type 11 – Time Exceeded
Type 12 – Parameter problem
Code (8-bit): Code is the next 8 bits of the ICMP packet format, this field carries some
additional information about the error message and type.
Checksum (16-bit): Last 16 bits are for the checksum field in the ICMP packet header.
The checksum is used to check the number of bits of the complete message and enable the
ICMP tool to ensure that complete data is delivered.
The next 32 bits of the ICMP Header are Extended Header which has the work of pointing
out the problem in IP Message. Byte locations are identified by the pointer which causes
the problem message and receiving device looks here for pointing to the problem.
The last part of the ICMP packet is Data or Payload of variable length. The bytes included
in IPv4 are 576 bytes and in IPv6, 1280 bytes.
IPv6:
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP),
the communications protocol that provides an identification and location system for
computers on networks and routes traffic across the Internet.
IPv6 provides other technical benefits in addition to a larger addressing space. In particular, it
permits hierarchical address allocation methods that facilitate route aggregation across the
Internet, and thus limit the expansion of routing tables. The use of multicast addressing is
expanded and simplified, and provides additional optimization for the delivery of services.
Device mobility, security, and configuration aspects have been considered in the design of
the protocol.
IPv6 addresses are represented as eight groups of four hexadecimal digits each, separated by
colons. The full representation may be shortened; for
example, 2001:0db8:0000:0000:0000:8a2e:0370:7334 becomes 2001:db8::8a2e:370:7334.
IPv6 is an Internet Layer protocol for packet-switched internetworking and provides end-to-
end datagram transmission across multiple IP networks, closely adhering to the design
principles developed in the previous version of the protocol, Internet Protocol Version
4 (IPv4).
Multicasting:
In IPv4 it is very difficult for an organization to get even one globally routable multicast
group assignment, and the implementation of inter-domain solutions is arcane.[17] Unicast
address assignments by a local Internet registry for IPv6 have at least a 64-bit routing prefix,
yielding the smallest subnet size available in IPv6 (also 64 bits). With such an assignment it
is possible to embed the unicast address prefix into the IPv6 multicast address format, while
still providing a 32-bit block, the least significant bits of the address, or approximately 4.2
billion multicast group identifiers. Thus each user of an IPv6 subnet automatically has
available a set of globally routable source-specific multicast groups for multicast
applications.[18]
Difference Between IPv4 and IPv6
IPv4 IPv6
Address representation of
Address Representation of IPv6 is in hexadecimal
IPv4 is in decimal
Fragmentation performed
In IPv6 fragmentation is performed only by the
by Sender and forwarding
sender
routers
available
It has a broadcast
In IPv6 multicast and anycast message
Message Transmission
transmission scheme is available
Scheme
IPv4 supports
VLSM(Variable Length IPv6 does not support VLSM.
subnet mask).
66.94.29.13 2001:0000:3238:DFE1:0063:0000:0000:FEFB