You are on page 1of 68

UNIT-3

Circuit Switching Vs Packet switching / Packet Switched Networks IP ARP RARAP


DHCP ICMP - Queuing discipline - Routing algorithms RIP OSPF Sub netting CIDR
-Interdomain routing BGP - IPV6 Multicasting - Congestion avoidance in network layer.

3.1 Switching:
A Switched network consists of a series of interlinked node called Switches. Switches are
network and / or software devices capable of creating temporary connections between 2 or more
devices linked to the switch but not to each other. There are three methods in Switching namely
Circuit Switching, Packet Switching and Message Switching.

3.1.1 Circuit Switching:


It creates a direct physical connection between 2 devices such as phones or computers. A Circuit
switch is a device with n input & m output that creates a temporary connection between an input
link & an output link. The telephone system was designed for voice & analog signals. Sending
data requires bandwidth.
Amount of bandwidth Desired data rate

Fig:3.1 Circuit Switching


The regular telephone loop from the local office to the phone is guaranteed by the phone
company to have some specific characteristics. This lowest performance line is called as voice
grade conditioning. The lines that go between phone company offices. These interoffice lines

are called trunks.Any phone line can connect one user to another user through the phone
system; the user has a line assigned randomly. This is called as dial-up or Switched network.
Telephone networks are connection oriented because they require the setting up of connection
before the actual transfer of information can take place. An end-to-end path setup beginning of a
session , dedicated to the application , then released at the end of session is called as Circuit
Switching.

3.1.1.1 Routing in Circuit Switching:


Take the decision for routing between the end nodes.
To phone

Direct
Switch 1

path

Switch 2

Switch
Fig: 3.2 Routing in Circuit tandem
Switching
Routes between end Office A to B:
Route 1: A 1 B
Route 2: A 3 B
Switch tandem
Route 3: A B

3.1.1.2 Routing Control:


It is used to find the path for data flow from source to destination. Hierarchical approach is
desirable when the volume of traffic between switches is small.
Trunk
Switch 2

Switch 1

Fig 3.3 Routing control


The sub-switches are connected with closed main switches. Between the main Switches, long
distance trunks are required to handle the traffic.

3.1.1.3 Switch Tandem:


It is a switch which is used to provide the alternate path to reach the destination from the source
called as switch tandem.
Call request signal
signal

Propagation delay

Processing delay

Call accept

User data
Link

Nodes

Link

Link

4
Acknowledgement signal

Fig: 3.4 Timing Diagram


Merits:
Fixed bandwidth guaranteed capacity.
Low variance end to end delay.
Demerits:
Connection set up introduces extra overhead.
User pay for circuit even when not sending data.

3.1.1.4 Message switching:


It is used to describe the telegraph network no physical path is established in advance between
sender & receiver. When the sender has a block of data to be sent it is stored in the first switching
office i.e. router & then forwarded later. Each block is received in its entirely inspected for errors
& then transmitted. It is called as a store & forward network.There is no limit on block size,
which means that routers must have disks to buffer long blocks.
Message 2

Message 2
Store &
Forwar
d

Message 1
Store &
Forward

Message 1

Message 2
Store &
Forwar

Store &
Forwar

Fig 3.5 Message Switching


Merits :
Efficient traffic management
Reduces network traffic congestion
Call request Packet

Call accept Packet

PKT 1
PKT 2
PKT 3

PKT1
PKT 2

PKT1
PKT 2
PKT 3

PKT 3
Ackowledgement Packet

Nodes

1
2
Fig: 3.6 Timing Diagram

Demerits:
1. Transmission delay will be increased.
2. Each node requires large capacity for storing.

3.1.2 Packet switching:


The messages are broken into short blocks & interleaved with other messages. Each packet is
forwarded from switch to switch, eventually reaching its destination. Each switching node has a
small amount of buffer space to temporarily hold the packets. If the outgoing line is busy, the
packet stay in queue until the line becomes available.

3.1.2.1 Properties:
Fixed number of inputs & outputs.
The point to point link is maintained between the switches.
Adding new host will not reduce the performance.
High scalable.
It uses the identifier to find the host. It is classified into 3 types:
Datagram approach
Virtual circuit approach
Source routing
Assumptions:
Each host has unique identifier (globally unique).
Two ways to find port
Number the ports
By name of port
Datagram approach:
Connectionless approach.
Each packet is routed independently through the network. Header is attached with each packet. It
provides all information to route the packet to the destination.
If the transmission line is busy then the packet is placed in the queue until the line becomes free.
Characteristics:
Send anywhere & anytime.
No way to know the capacity of the network.
Independent forwarding.
No problem in case of failure.

switch

consults

forwarding

table

before

starts

the

forwarding.

Fig: 3.7 Datagram forwarding


Table: Forwarding Table for switch2
Destination

Port

C
E
A
B
D

3
2
3
1
3

Host C is connected with switch2 via switch1 at port 3(in switch 2). Likewise, for Host E,A,B,&
D are connected with switch2 via switch1.
Virtual circuit approach
A preplanned route is established before any packets are sent.Because of the route is fixed for the
duration of the logical connection, it is referred as VIRTUAL CIRCUIT.No routing decisions
are required.Each packet contains a virtual circuit identifier, instead of destination address.

Two stages of Virtual Circuit Process:


Connection setup

Data Transfer
Connection setup
A connection is established in each of the switches between the source & the destination.
Data Transfer
The connection state for a single switch connection consists of an entry in VC table in each
switch through which the connection passes.
E.g.: VC Entry on a single switch contains 4 parts i.e.
1. Virtual Circuit Identifier (VCI).
2. An incoming interface.
3. An outgoing interface. In which packets for this VC leave the switch.
4. A different VCI will be used for outgoing packets.
VC Entry Table:
Incoming Interface

Incoming VCI

Outgoing Interface

Outgoing VCI

Fig 3.8 Virtual Circuit


TABLE : VIRTUAL CIRCUIT TABLE ENTRY FOR SWITCH1
INCOMING
INFORMATION
2

INCOMING

OUTGOING

OUTGOING

VCI

INFORMATION

VCI

11

TABLE : VC ENTRY FOR SWITCH2


INCOMING
INFORMATION
3

INCOMING

OUTGOING

VCI

INFORMATION

11

OUTGOING
VCI
7

TABLE : VC ENTRY FOR SWITCH3


INCOMING
INFORMATION
0

3.1.3 SOURCE

INCOMING

OUTGOING

VCI

INFORMATION

OUTGOING
VCI
4

ROUTING :

All the information about n/w topology that is required to switch a packet across the n/w
is provided by the source host
IMPLEMENTATION :
Assign a number to each output of each switch and to place the number in the header of the
packet. The switching is simple. For each packet that arrives on an i/p,the switch would read the
PORT NUMBER in the header and transmit the packet on that o/p

1 is the output port .0 is the input port


Fig 3.9 Source Routing

Fig 3.9 Source Routing in a switched network


There are 3 ways to handle the headers for source routing they are
Rotation
Stripping
Pointer
Header Entering Switch
D

D C B

Ptr D C

B A

Ptr

Header Leaving Switch


A

3.2 IP : ( Internetworking

D C

Protocol)

An internetwork is an interconnected collection of networks that are interconnecting as a


physical networks. A collection of Ethernets connected by bridges (or) switches would still
be viewed as a single n/w .It is referred to as a network of networks.

Fig 3.10 A Simple Network


The nodes that interconnect the networks are called Routers. It is also called as a
gateway. The internet protocol (IP) is used to build Scalable , heterogeneous internetworks. It
runs on all the nodes ( both hosts & routers ) in a collection of networks & defines the
infrastructure that allows these nodes & networks to function as a single logical internetwork

3.2.1 Service Model :


It is the host to host service , only if this service can somehow be provided over each of the
underlying physical networks. It has 2 parts
Addressing scheme -> identify all hosts in the internetwork
Datagram -> Connectionless model of data is delivery
This service model is called best effort because , although IP makes every effort to deliver
datagrams ,it makes no guarantees

Datagram delivery :
Every datagram carries enough information to let the n/w forward the packet to its
correct destination
It doesnot make any attempt to recover from the failure .so it is called as a unreliable
service
Sometimes the packet can get deliverd out of order & sometimes the same packet can
delivered more than once
Packet Format
0

4
Version

8
IHLen

16
Tos

Identification
TTL

19
Length
Flags

Protocol

31
Offset

Checksum

Source Address
Destination Address

Pad(Variable)

Data

Version : IP Protocol version either IPV4 (OR)IPV6


HLEN : Length of the IP header
Minimum -> 5 (20 bytes)
Maximum -> 15 (60 bytes)
TOS : types of service ie quality of service requested for IP datagram
Length : total length of the datagram that is header and data
Identification : identification is a unique no assigned by the sender
Flags : it has control flags
1st bit -> reserved and must be zero
2nd bit (df) -> dont fragment,0->allow fragmentation
3rd bit (mf)-> more fragments,0->this is the last fragment
Fragment offset : reassemble the full datagram.it contains the no of 64-bit segment
contained in earlier fragments
TTL (Time to live) : specifics the time ,the datagram is allowed to travel
Protocol number : indicates the higher level protocol to which IP should deliver the data
Eg : ICMP=1,TCP=6,UDP=17
Checksum : a checksum for information contained in the header . if the header checksum
does not match the contents. the datagram is discarded

Sourceadds ,destination adds : 32 bit source/destination IP addresses


Options : for control (or) debugging 7 measurement
Pad :to ensure that the IPheader ends on a 32 bit boundary .the padding is zero

3.2.2 Fragmentation & Reassembly :


It has 2 choices
1.Make sure that all IP datagram are small enough to it inside one packet
2.Provide a means by which packets can be fragemented & reassembled when they are too big to
go over a given n/w technology
Idea :every n/w type has a maximum transmission unit (MTU), which is the largest ip datagram
that it can carry in a frame
When a host sends an IP datagram ,it choose any size that it wants.then the
fragmentation will only be necessary if the path to the destination
Fragmentation occurs in a route when it receives a datagram that it wants to forward over
a n/w that has an MTU that is smaller than the received datagram
The fragments are reassembled at the receiving host
Eg :MTU = 1500 bytes for Ethernet consider 1400 bytes packets to be transmitted

Fig 3.11 Fragmentation & Reassembly


802.11 n/w -> 1400 bytes
Ethernet MTU -> 1500 bytes
Point to point n/w MTU -> 532 BYTES
Two Important points :

Each fragment is itself a self-contained IP datagram that is transmitted over a sequence of


physical n/w
Each IP datagram is re- encapsulated for each physical n/w over which it travels

Start of header
Ident=x

(DF)
0

Offset=0

Rest of header
1400 bytes of data

Start of header
Ident=x

(DF) Offset =0
1
Rest of header
512 bytes of data

Fig 3.12 Unfragmented Packet

Fig 3.13 Fragmented (b),(c),(d) Packets

Start of header

Start of header
Ident=x

(DF) Offset=64
1
Rest of header
512 data bytes

Ident=x

(DF) Offset=128
0
Rest of header
376 data bytes

3.13 Fragmented (b),(c),(d) Packets


Offset -> 0 (first fragment is transmitting)
Increased by the multiples of 64
DF (donot fragment ) bit ->0 ,no more fragments , 1 ,more fragments to be sent
Data ->512 bytes multiples ,512+512+376=1400 bytes

Fig

Addressing scheme :
Way of identifying all the hosts so we need global addressing scheme
one in which no 2 hosts have the same address
Ethernet addresses are globally unique,but that alone does not sufficient for an addressing
scheme in a large internetwork
It contains 2 parts
n/w part : identifies the n/w to which host is attached
host part : identifies each host uniquely on that particular n/w

IP addresses types :
There are 5 categories they are
Class
Class
Class
Class
Class

A
B
C
D (for multicast)
E (Currently not in use )

Class A:
0

Network

Host

Class B :
1 0

Network

Host

Class C:
1 1 0

Network

Host

Class A:
First bit is 0
of addresses in 4 billion possible IP Addresses
n/w part -> 7 bits,host part -> 24 bits
can accommodate up to 2^24- 2 host (16 million)
Class B :

first bit is 1 ,second bit is 0


of addresses in 4 billion addresses
n/w part -> 14 bits, host part -> 16 bits
can accommodate up to 2^16 -2 hosts (65,534)
Class C:
First ,second bit is 1,third bit is 0
1/8 of addresses
n/w part -> 21 bits, host part -> 8 bits
can accommodate up to 2^8 -2 hosts (254)
Four decimal integer separated dy dots
Eg: 171.69.210.245
Datagram forwarding in IP :
IP routers forward datagram in an internetwork
Forwarding :
It is the process of taking a packet from an i/p & sending it out on the appropriate o/p

3.2.4 ROUTING:
It is the process of building up the tables that allow the correct output for a packet to be
determined.
Main Points for Forwarding of IP Datagrams:
Every IP datagram contains IP address of the destination host.
Network part of an IP address identifies a single physical network.
All hosts and routers that share the same network part of their address are connected to
the same physical network.
Every physical network is part of the Internet has at least one router.
Steps:
A datagram is sent from a source host to a destination host, possible passing through several
routers along the way.
It compares the network part of the destination address with the network part of the address of
each of its network interfaces.

If a match occurs then that means that the destination lies on the same physical network as the
interface and the packet can be directly delivered over that network.
If the node is not connected to the same physical network as the destination node, then it needs to
send the datagram to a router.
Each node will have a choice of several routers and so it needs to pick the best one, or at least
one that has a reasonable chance of getting the datagram closer to its destination.
The router finds the correct next hop by consulting its forwarding table.
Datagram Forwarding Algorithm:

if( NetworkNum of destination=NetworkNum of one of my interfaces)


then
deliver packet to destination over that interface
else
if( NetworkNum of destination is in my forwarding table)
then
deliver packet to NextHop router
else
deliver packet to default router

-For a host with only one interface and only a default router in its forwarding table.
-The forwarding table has a list of <NetworkNum, NextHop> pairs.
Simplified Algorithm:

if(NetworkNum of destination= my NetworkNum)


then
deliver packet to destination directly

else
deliver packet to default router

3.3 ADDRESS RESOLUTION PROTOCOL [ARP]:


Issue:
IP datagram contain IP addresses, but the physical interface network on the host or router to
which we want to send the datagram only understands the addressing scheme of that particular
network.
Solution:
-Need to translate the IP address to link-level address.
-We can encapsulate the IP datagram inside a frame that contains that link-level address and send
it either to the ultimate destination or to a router that promises to forward the datagram toward
the ultimate destination.

3.3.1 Way to Map IP Address:


-Encode a hosts physical address in the host part of its IP address.
Eg:- host with physical address 00100001(33)
128.96.33.81.

01001001(81) might be given the IP address

It is not suitable for 48-bit Ethernet address.


Solution:
Maintain a table of address pairs (ie.)the table would map IP addresses into physical addresses.
Goals of ARP:

-The goal is to enable each host on a network to build up a table of mappings between IP
addresses and link-level addresses.
-Since these mappings may change over time, the entries are timed out periodically and removed.
It happens on the order of every 15 minutes.

3.3.2 ARP Cache (or) ARP Table:


-The set of mappings currently stored in a host is known as the ARP CACHE (or) ARP
TABLE.

Steps:

-If a host wants to send an IP datagram to a host(or router) that it knows to be on the same
network, it first checks for mapping in the cache.
-If no mapping is found, it needs to invoke ARP over the network.
-It broadcasts an ARP query onto the network. Each host receives the query and checks to see if
it matches its IP address.
-If it does match, the host sends a response message that contains its link-layer address back to
the origination of the query.
-The originator adds the information contained in the response to its ARP table.

Query message IP address + Link-Layer address of the sending host

-When a host broadcasts a query message, each host on the network can learn the senders linklevel and IP addresses.
-It places that information in its ARP table.
-If the host already has an entry for that host in its table, it refreshes this entry. If that host is the
target of the query, it adds information about the sender to its table, even if it did not already
have an entry for the host.
-If a host is not the target and does not already have an entry for the source in its ARP table, then
it does not add an entry for the source.

3.3.3 Packet Format:


Hardware Type =1

Protocol Type = 0*0800

HLen=48

PLen=32

Operation

Source Hardware Addr (bytes 0-3)


Source Hardware Addr(bytes 4-5)

Source Protocol Addr(bytes 0-1)

Source Protocol Addr(bytes 2-3)

Target hardware addr(bytes 0-1)

Target hardware addr(bytes 2-5)


Target protocol addr(bytes 0-3)

Hardware Type: Specifies the type of physical network. (Eg. Ethernet)


Protocol Type: Specifies the higher layer protocol. (Eg. IP)
HLen: Hardware addresses length length of the link layer address.
PLen: Protocol addresses length-->length of the higher layer protocol address.
Operation: Specifies whether this is a request or a response.
Source Hardware Addr, Target Hardware Addr, Source Protoco Addr,Target Protocol Addr :
Source and target hardware (Ethernet) &protocol (IP) addresses.

3.4 REVERSE ADDRESS RESOLUTION PROTOCOL


[RARP]:
In some situations, a host may know its MAC address but not its IP address. The IP address is
usually kept separately in a disk at the server.
Definition:
The mapping of MAC address into an IP address is called as RARP.
Steps:
-The sender broadcasts a RARP request that specifies itself as both the sender and target
machine.
-All the machines on the network receive the request but only those authorized to supply the
RARP service process the request & send a reply, such machines are known as RARP Server.

Two Messages:
Request specifies both the sender &target machine.
Reply send IP address As response directly to the machine making the request

3.4.1 Drawbacks of RARP:


Since it operates at low level, it requires direct address to the network which makes it difficult
for an application programmes to build a server.It doesnt fully utilizes the capability of a
network like Ethernet which is enforced to send a minimum packet size since the reply from the
server contains only one small piece of information, the 32-bit internet address

3.5 DYNAMIC HOST CONFIGURATION PROTOCOL


[DHCP]:
If addresses must be unique on a given internetwork, but also must reflect the structure of the
internetwork. A host once connected to one network could never move to another. For this
reason, IP addresses need to be reconfigurable A host needs to have an IP address and some
other pieces of information before it can start sending packets ie) it needs the address of the
default router to which it can send packets whose destination address is not on the same
network .

3.5.1 Drawbacks Of Manual Configuration :


Lot of work to configure (when we consider that the hosts are not reachable over
a network until they are configured).
Difficult to provide unique address (it is necessary to ensure that every host gets
the correct network number and number2 hosts receives the same IP address).

3.5.2 DHCP:
-Automated configuration protocol.
-DHCP server is responsible for providing configuration information to hosts.
There is at least one DHCP server for an administrative domain.

-The configuration information for each host could be stored in the DHCP server
and automatically retrieved by each host when it is booted or connected to the network.
-It is stored in a table that is indexed by some form of unique client identifier,
typically the hardware address.
-In this model, DHCP server saves and maintains a pool of available addresses that
it hands out to hosts on demand.
-It reduces the amount of configuration an administrator must do, since now it is
only necessary to allocate a range of IP addresses to each network.
Goal : minimize the amount of manual configuration required for a host to function
Problem : server discovered.
To Contact A DHCP Server:
A newly booted or attached host sends a DHCP DISCOVER message to a special IP
address(255.255.255.255) that is an IP broadcast address
IT will be received by all host & routs on that n/w
DHCP server should be one of the nodes from the n/w
Steps:
1.A newly attached host broadcast a DHCP DISCOVER msg to a special IP address
2.The server would reply to the host that generted the discovery msg.In same n/w,it has a
potentially large no.of server that need to be correctly &consistently configured
3.DHCP uses the concept of a relay agent.There is atleast one relay agent on each n/w,&
it is configured with just one piece of info(IP address of the DHCP server).
4. When a relay agent receives a DHCP DISCOVER msg,it unicasts it to the DHCP
server & awaits the respones ,which it will then send back to the requesting client
the msg is actually sent using a protocol called User DatagramProtocol(UDP) that runs
over IP

broadcast

DHCP
Relay

others
n/ws

server

Fig 3.15 DHCP Protocol

DHCP

3.5.3 DHCP Packects


0
8
Operation HType

16
HLen

24

31
Hops

X id
Seconds

Flags

Ciadds
Yiadds

Siadds
Giadds
Cbadds(16 bytes)
Sname(64 bytes)
File(128 bytes)
Options
1. Operation: Specifies whether the message is a request or a response.
2. Htype: Specifies the n/w hardware type.
3. HLen: Specifies the length of a h/w address.
4. HOPS: Specifies how many servers forwarded the request.
5.Xid: Transaction Identifies which provides a value that a client can use to find if an incoming
response matches its request.

6.Seconds: Time taken to forward packets.


7.Flags: Various option that a client uses to discover servers(or) request an address (or) that a
server uses to acknowledge.
8.Ciadds: clients IP address.
9.Yiadds: Server uses this field (i.e) your IP address.
10.Siadds: Server IP address.
11.Giadds: Gateway (or) router IP address(default router).
12.Cbadds: Client hardware address(16 bytes).
13.Sname: Server host name(64 bytes).
14.File: Boot file name
15.Option: To encode additional information.
Drawback/Complexity:

Since it makes the binding between physical host &IP address much more dynamic.This may
make the n/w manager's job more difficult.

3.6 ICMP(Internet Control Message Protocol):


When a router does not know how to forward the datagram (or)when one fragment of a datagram
fails to arrive at the destination, it does not necessarily fail silently.
Solution:
ICMP defines a collection of error message that are sent back to the source host whenever a
router orhost is unable to process an IP datagram successfully.
Three Reasons for IP can't deliver the packet to thedestination:
1. if the packet's TTL has expired
2. if the route to the specified destination address is missing from the routing table.
3.if the gateway does not have sufficient buffer space.
ICMP message are encapsulated by IP packects

ICMP
message
IP header
Frame header

IP data

Frame data

Trailer

Fig 3.16 ICMP Encapsulation


MessageTypes:
All ICMP message fall in the following classes:
1.Error Reporting
2.Query

3.6.1 Main function of ICMP:


The main function associated with the ICMP are follows:
1. Error Reporting
2.Reachability testing
3.Congestion Control
4.Route Change Notification
5.Performance Measuring
6.Subnet addressing

3.6.2 Message Format:


0

16

31

Type

Code

Checksum

Reset of the header


IP header & 64 bits of original datagram

1.TYPE: 8 bits field identifies the type of the message.


2.CODE: 8 bits field which provides the info or parameters of the message type.
3.CHECKSUM: 16 bits field is used to detect errors in the ICMP message.
4.IP header + original datagram: Used for diagnostic purposes by matching the info/- n the ICMP
msg with the original data in the IP packet.

3.6.3 ERROR REPORTING:


ICMP does not correct errors, it simply reports them. It handles five types of errrors:
1.Destination unreachable
2.Source quench
3.Time exceeded
4.Parameter problem
5.Redirection
ICMP uses the source IP address to send the error msg to the source of the datagram.

3.6.3.1 Destination unreachable:


It is sent by a router, in response to a packet which it cant't forward because the
destination in unreachable.
Type field

ICMP message type

Description

Echo reply

Device in the n/w is alive

Destination unreachable

Router
can't
destination

Source quench

When host send too many


packet

find

the

Redirect

Forward the packets to the


shortest path router

Echo request

Device in the n/w is alive

11

Time exceeded

If TTL is zero, discard the


datagram

12

Parameter pblm

If the header field is invalid

13

Time stamp request

Define delay characteristics

14

Time stamp reply

Define delay characteristics

17

Address most request

For getting most address

18

Address most reply

For getting most address

Router advertisement

Broadcast routing information

10

Router solicitation

Broadcast routing information

Type:3

Code: 0 to 15

Checksum

Unused(All os)
IP datagram + header
Fig:3.17 Destination unreachable format
1.code: It has 0 to 15 different message
eg)

Not unreachable

Host unreachable

Protocol unreachable

Port unreachable

Fragmentation needed &DF set

Source route failed

2.Checksum: 16 bit one's complement of the one's complement sum of the ICMP msg starting
with the ICMP type
3.Unused: 32 bit are not used & ignored

3.6.3.2 Source quench:


Used to report congestion to the original source.
It is a request for the source to reduce the current rate of datagram tranmission.
Type:4

Code:0

Checksum

Unused(All os)
IP datagram + header
Fig:3.18 Source quench format
1.code: It is always 0.
All the other fields are same.

3.6.3.3 Time exceeded:


Every IP datagram contains a field called 'time to live' or TTL. If it gets zero the
datagram is discarded to prevent the datagram from floating around the n/w forever.
Type:11

Code:0/1

Checksum

Unused(All os)
IP datagram + header
Fig:3.19 Time exceeded format
1.Code:
0
1

Time to live exceeded in transit


Fragment assembly time exceeded

3.6.3.4 Parameter problem:


If the gateway or host finds a problem with the header parameter such that it can't
complete processing the datagram it must discard the datagram.
Type:12

Code:0/1

Checksum

Unused(All os)
IP datagram + header
Fig 3.20 Parameter problem format
1.Code:
It is 0 when the pointer field indicates the error
It is set to 1, when there is no error
2.Pointer:
Identifies the original datagram's header where the error was detected.

3.6.3.5 Redirection:
If a router A receives a datagram to forward from a host in the same n/w. The router
A checks its routing path is via another router (Routre B) on the same n/w.
For redirecting message to the host.
It can only be sent by routers.
Type:5

Code:0 to 3

Checksum

IP address of the target router


IP datagram + header
Fig :3.21:Redirection format
1.code:
0
Redirect datagram for n/w
1
Redirect datagram for host
2
Redirect datagram for the type service & n/w
3
Redirect datagram for the type of service & host
IP address of the target address:
Gateway internet address which is used to indicate the router with the shortest path
to the destination network.

3.6.4 QUERY
ICMP query message are of four types
1.Echo request &reply

2.Timestamp request &reply


3. Address mask request &reply
4. Router solicitation & advertisement
a) Echo request &reply:
For diagnostic purposes
To identify n/w problems
Both are used to test the communication path from a sender to a receiver.

Type:8(or)0

Code:0

Checksum
Identifier

Sequence number
Optional data
Fig 3.22 Echo Request & Reply format
1.Type:
0
1

Echo request
Echo reply

2. Identifier & Sequence number: not used.


b) Timestamp Request & reply:
To calculate the RTT between a source & a destination
Type:13/4

Code :0

Checksum

Identifier (16 bits)

Sequence number(16 bits)

Original timestamp (32 bits)


Receive timestamp
Transmit timestamp
Fig 3.22 Timestamp Request & Reply format
1.Type:
13 --> Request, 14 --> Reply
Identifier & Sequence number:
It may be used by the echo sender.

Original Timestamp:
Time in units of 32 milliseconds when the datagram was transmitted from the source
Receive Timestamp:
Time, when the datagram was received at the destination
Transmit Timestamp:
Time, when the Timestamp reply datagram reply datagram was transmitted from the
destination
Sending Time = Receive Timestamp - Original Timestamp
Receiving Time = Returned Time -Transmit Time
Round -Trip Time = Sending time + Received Time
C)Address Mask Request & Reply:
Used by a host to find what its address mask is on a network.

Type:17/18

Code :0
Identifier

Checksum
Sequence No.

Address mask
Fig: 3.23 Address Mask Request & Reply
Type: 17 --> request, 18 --> reply.
Address mask: Contains 32-bit subnet mask for the network (enabled only in the response)
d)Router Solicitation & Advertisement:
Router Solicitation --> To send notification to all routers, which broadcast on current
network.
Router advertisement --> broadcast their routing information

Type :10
Identifier

Code :0

Checksum
Sequence No.

Fig:3.24 Router Solicitation message format

Type :19

Code :0

No. Of addresses

Address entry size

checksum
lifetime

Router address 1
Address preference 1
Router address 2
Address preference 2
.
.
.
Fig:3.25 Router Advertisement message format

Lifetime: no.of seconds that the entries are considered to be valid.


No. Of addresses: Specifies the no. Of addresses to be sent/broadcast
Address Entry Size:Specifies the length of address to be entered into the routing table
Router Address: Address of the router to be passed
Address Preference: Address to be considered in case of router address failure.

3.7 QUEUEING DISCIPLINES


Motivation:
Allocating bandwidth (which packets get transmitted)
Allocating buffer space(which packets get discarded)
It also directly affects the latency experienced by a packet by determining how long a packet
waits to be transmitted

3.7.1 Queueing Algorithms:


It introduces Two common techniques.
FIFO (First In First Out)
Fair Queueing

FIFO:
Idea: first come, first served queueing.
It is simple.
The first packet that arrives at a router is the first packet to be transmitted.
If a packet arrives & the queue is full, then the router discards that packet,as shown in the
following figure.
It is done without regard to which flow the packet belongs to which flow the packet belongs to as
how much important the packet is. It is called as tail drop.
Drop tail/Drop Policy:
Since the packets that arrive at the tail end of the FIFO are dropped.So it is called as tail
drop/drop tail/drop policy

Two Techniques:
1.Scheduling discipline --> It determines the order in which packets are transmitted.
2.Drop Policy --> It determines which packets get dropped.
Arriving packets
Free buffers

Next free buffer

Next to trans

Queued packets
Fig :3.26 FIFO Queueing

Arriving packets

Drop

Next to transmit
Fig :3.27 Tail drop at a FIFO Queue

It pushes all responsibility for congestion control & resource allocation out to the edges of the
network.
Assume that there is no help from the routers, then TCP takes responsibility for detecting &
responding to congestion.
3.7.1.2 Priority queueing:
A Simple variation on basic FIFO queueing.The idea is to mark each packet with a priority.The
mark could be carried.
It implements multiple FIFO queues, one for each priority class
Three priority classes
Low
Medium
High
The router always transmits packet out of the highest-priority queue if that queue is nonempty
before moving on to the next priority queue.
Problem: The idea is a small departure will win during the transmission.so the high-priority
queue can starve out all the other queues.
Solution: The network could change more to deliver high priority packets than low-priority
queue can starve out all the other queues.
Here, the routing updates that are necessary to stabilize the routing tables after a topology
change.
For that packets, there is a special queue, which can be identified by the differentiated services
code point.

3.7.1.3 Fair Queueing:(FQ)


Drawback of FIFO:
1.does not differentiate between different traffic sources.
2.does not seperate packets according to the flow to which they belong.
This is a problem in 2 levels.
At one level it is not clear that any congestion control algorithm implemented entirely at the
source.
At the another level, the entire congestion control mechanism is implemented at hte sources &
FIFO queueing does not provide a means to police how well the sources adhere to this
mechanism.
It is possible for an ill behaved source to capture large fraction of network capacity (problem)
Solution:
Fair Queueing is an algorithm to address this problem.
Idea:to maintain a seperate queue for each flow currently being handled by the router.
When a flow sends packets too quickly, then its queue fills up.when a queue reaches a
particular length, additional packets belonging to that flows queue are discarded
So it wont increase its share of the networks capacity at the expense of other flows.
Flow 1

Flow 2

Round Robin Service

Flow 3
Problem in FQ:
1.The router is not telling the traffic sources anything about the state of the router
2.no way for limiting how quickly a given source sends packets.
It segregates the traffic so that ill-behaved traffic sources do not interfere with those that are
faithfully implementing the end-to-end algorithm.

Problem:
The packets being processed at a router are not necessarily the same length.so we have to
consider the length of the packets
Eg:Router has 2 flows
Flow1 -->1000 bytes packets -->allocate 2/3 of bandwidth
Flow2 -->500 bytes packets of bandwidth 1/3 of bandwidth

3.7.1.4 Bit-by-Bit round robin


The router transmits a bit from flow1 then a bit from flow1 then a bit from flow 2 & so on.It
is not feasile.So approximately bit-by-bit round robin introduced.
Solution:
Imagine a clock that ticks once each time one bit is transmitted from all of the active flows.
Pi -->length of the packet i
Si -->the time when the router starts to transmit packet i
Fi -->the time when the router finishes transmitting packet i.
Fi=Si+Pi
If the new flows of packets arrives before the current running flow completion.It will
transmit the packets immediately.
If the new flow arrives after the current flow completion,R-R mechanism could not transmit
any packets from this flow.
Ai -->arrival time of new
Si = max(Fi-1, Ai)
Fi = max (Fi-1, Ai) +Pi
Work Conserving:
The effect of being work conserving is that if any one is sharing a link with a lot of flows that
are not sending any data then they can use the full link capacity for their flow.
ie)share the available capacity

3.7.1.5 Weighted fair queueing: (WFQ)


It allows a weight to be assigned to each flow(queue).It is logically specify how many bits to
transmit each time the router services thst queue.

3.8 ROUTING
Forwarding table

Routing Table

It contains the mapping from a network


It contains the mapping from network
prefix to an outgoing interface
prefixes to next hops
Just forwards to next i/f (or) hop

Stores the path & next hop, cost in the


table & choose the shortest path

3.8.1 Network as a graph:


The nodes of the graph, labeled A through F, may be hosts, switches, routers, (or) networks.
The edges of the graph correspond to network links.Each edge has an associated cost.
Fig: Network represented as a graph

6
F

1
B

E
1

D
Fig: 3.28 Network represented as a graph

Problem of Routing:

Find the lowest cost path between any two nodes, where the cost of a path equals the sum of
the costs of all the edges that make up the path.
Two Types of Routing Approach:

3.8.2.1.Static approach: load all shortest path into some nonvolatile storage.
Problem:
Does not deal with node/link failure.
Does not consider the addition of new nodes (or) links.
Imples that edge costs cannot change.

3.8.2.2 Dynamic

Approach:

In this approach, the problems of static approach will be resolved. There are 2
main classes of routing protocols, such as,
Distance vector(DVR)
Link state (OSPF)
3.8.2.2.1 DISTANCE VECTOR ROUTING: (DVR)
Each node constructs a one-dimensional array (a vector) containing the distance (costs)
to all others nodes & distributes that vector to its immediate neighbours.
Assumption:
Each node knows the cost of the link to each of its directly connected neighbours.
The costs may be provided when the router is configured by a n/w manager.
A link is down, it is assigned an infinite cast.
Infinite Cost:
Eg) consider the following graph, The cost of each link is set to 1.
B
A

E
F

G
Fig 3.29 Example Graph

We can represent each nodes knowledge about the distances to all other nodes as a table
STEP 1:
TABLE : Initial distances stored at each node

Each node knows only the information in one row of the table
Node is directly connected

cost is 1

One node to same node

cost is 0 (ie, A A , B B..)

To all other nodes

cost is

Initially A believes that it can reach B in one hop and that D is unreachable

STEP 2:
Every node sends a message to its directly connected neighbours containing its
personal list of distances

Eg) TABLE: Initial routing table at node A

Destination

Cost

NextHop

Like the above table all nodes have its personal list of distances
Send the routing information as < Destination , Cost , Next Hop>
Eg) F tells node A that it can reach node G at a cost of 1. (ie like < G , 1 , G >
ie) A D , A G , cost is from the initial distances ( GLOBAL VIEW )
Now A found that it can reach G via F at the cost of 2 ( A F (cost 1 ) + F G ( cost 1 )
so totally 2 cost )
Likewise A found that it can reach D via C at the cost of 2 ( A C ( cost 1 ) + C D ( cost 1 )
so total cost is 2)
Similarly, it will find all distances ( costs ) for each node.
TABLE : Final routing table at node A

Destination

Cost

NextHop

If any topology changes it takes only a few exchanges of information between neighbours
before each node has a complete routing table
Convergence:
The process of getting consistent routing information to all the nodes is called
convergence
This algorithm enable all nodes to achieve a consistent view of the network in the absence
of any centralized authority
TABLE: Final distances stored at each node ( GLOBAL VIEW )

Distance to reach node


Destination stored at node
A

Two types of routing updates:


Periodic Update:
Each node automatically sends an update message every so often even if nothing
has changed.
Triggered Update:
When a node notices a link failure or receives an update from one of its neighbors.
When a node detects a link failure it will set the distance of that node as . Then find a new
distance and update the routing table.
Count to infinity problem :
If the link from A to E goes down it set the distance as .
But B, C advertise a distance of 2 to E. In this situation B near that E can be reached
in 2 hops from C, concludes that it can reach E in 3 hops.

Now A concludes that it can reach E in 4 hops. Now C concludes that it can reach E
in 5 hops. Likewise it increases the distance but none of the nodes actually knows that E is
unreachable this is called as Count to infinity
Solution:
Use some relatively small number as an approximation of infinity.
Techniques To Stabilize Routing
SPLIT HORIZON:
When a node sends a routing update to its neighbours it doesnot send those routes it
learned from each neighbour back to that neighbour.
Eg) B has the route < E , 2 , A > it is learned from A. so it wants forward to A.
SPLIT HORIZON WITH POISON REVERSE:
Instead of omitting the forwarding to the learned node, here assign a negative
information in the route.
Problem In Both The Techniques :
They only work for routing loops that involve 2 nodes.

Routing Information Protocol:( RIP)


GOAL: How to forward packets to various networks
Instead of advertising the cost of reaching other routes , the routes advertise the cost of
reaching networks.

B
A

5
2
D
C
3

Routes C advertises to route A the fact that it can reach networks 2 and 3 at cost of 0,
networks 5 and 6 at cost of 1, and networks 4 at cost of 2.
The packet is sent as,
< Address , mask , distance>
RIP send their advertisements every 30 secs.
0

Command

16
Version

Family of net 1

31
Must be zero

Route Tags
Address Prefix of net 1
Mask of net 1

Distance to net 1

Fig:3.30 RIPv2 packet format


Version : -2 for RIPv2
Family of net1: Address family of network 1
Route Tags : Used to route the information to all other networks
Address prefix of net1 : Prefix to be used in the network1
Mask of net1 : Mask address of the network1
Distance of net1 : The distance to be taken to reach this network

3.8.2.2.2 LINK STATE ROUTING : (OSPF)


Each node is assumed to be capable of finding out the states of the link to its neighbours and
the cost of each link.
Idea: Each node knows how to reach its directly connected neighbours.
Finding the shortest path to any point in the network.
Two Mechanisms:
Reliable Flooding of link state information
Calculation of routes from the sum of all the accumulated link state knowledge.
Reliable Flooding:
It is the process of making sure that all nodes participating in the routing protocol get a
copy of the link state information from all the other nodes.
A node send its link state information out on all of its directly connected links each node
receives this information and forwards it out on all of its links.
This process continues until the information has reached all the nodes in the network.
Link State Packet (LSP):
Each node creates an update packet called as Link state packet
It contains the following information
ID of the node that created the LSP
A list of directly connected neighbours with the cost
A sequence no
A time to live for this packet
First 2 needed for route calculation
Next 2 (last) needed for reliable delivery
Flooding:
Transmission of LSPs between adjacent routers
Use acknowledgements for retransmissions
Eg) Consider the following dig, node X receives a copy of an LSP , originated at node Y

First X checks to see if it has already a copy of an LSP. If not stores the LSP.
If it already has a copy it compares the sequence nos.
Is larger than the stored old LSP(It replace the
old LSP by new LSP)

Sequence no of LSP

Is smaller than the stored old LSP.(It will discard


the new LSP)

If the received LSP was the newer one, X then sends a copy of that LSP to all of its neighbours
except the neighbour from which the LSP was just received.

(a)

B
(b)

(c)

(d)
Fig 3.31 Reliable Flooding

Each node generated LSPs under two circumstances ie)


Expiry of a periodic time
Change in topology can cause a node to generate a new LSP
The newest information must be flooded to all nodes as quickly as possible
To reduce the overhead is to avoid generating LSPs unless absolutely necessary. It can be done
by using very long timers.
LSPs carry sequence numbers each time a node generate a new LSP it increments the sequence
number by 1. LSPs carry a time to live it is used to ensure that old link state information is
eventually removed from the network.
ROUTE CALCULATION :
It is the process of computing complete map for the topology of the network
The route calculation is based on well known algorithm from graph theory ie)
DIJKSTRAS SHORTEST PATH ALGORITHM :
N set of nodes in the graph
L(i,j) non-negative cost
L(i,j) if no edge connects i and j

Algorithm: (for shortest path determination)


M={s}
For each n in N-{s}

C(n)=l(s,n)
While(Nm)
M=mu{w}such that c(w) is the minimum for all w in (N-M)
For each n in (N-M)
C(n)=MIN(c(n),c(w)+c(w,n))
It is called the forward search algorithm. each switch maintains two lists .
Tentative.
Confirmed.
Each of these lists contains a set of entries of the form <destination, cast, next hop>
Algorithm:
Initialize the confirmed lists with an entry for myself; this entry has a cost of zero.
Added node in the previous step, call it node next & select its LSP.
For each Neighbour of Next, calculate the cast to reach this Neighbour as the sum of the
sum of the cast from myself to Next & from Next to Neighbour.
a)Neighbour is on neither Confirmed nor Tentative list then add <Neighbour, cast ,next
hop> to the Tentative list.
b)Neighbour is currently on Tentative list &cast is less than the currently listed cost for
Neighbour then replace the current entry with <Neighbour, cast, next hop>
If the Tentative list is empty, stop otherwise pick the cast, move it to the Confirmed list &
return to step 2

Eg:

step

confirmed

Tentative

1.

(d,0,-)

2.

(D,0,-)

(B,11,B)(C,2,C)

We can reach B via B at cost 11, better than any


other lists.so add it into Tentative same for C.

3.

(D,0,-)(C,2,C)

(B,11,B)

Put lowest cast member of Tentative (C) onto


Confirmed list.Next, examine LSP of
newly
confirmed member (C).

4.

(D,0,-)(C,2,C)

(B,5,C)(A,12,C)

Cost to reach B via C is 5.so replace (B,11,B) c is


LSP tells us we can reach A at cost 12.

5.

(D,0,-)(C,2,C)

(A,12,C)

Tentative of (B) is lowest cost.so move it to


confirmed list.

(A,10,C)

We can reach A at cost 5 althrough B,replace


Tentative entry

Based on Ds LSP, D is the only new member of the


confirmed list.

(B,5,C)
6.

Comments

(D,0,-)(C,2,C)
(B,5,C)

Final confirmed list(D,0,-)


(c,2,c)
(B,5,c)
(A,10,c)
The tentative list is empty so we will stop the process.
Open Shortest Path First (OSPF):-

It is based on the distributed map concept ie)all nodes have a copy of the network map, which
is regularly updated.
Each node contains a routing directory database. It has information about the routes
interfaces like status of adjacent routes.
It computes the shortest of adjacent routes.

It is classified as an internal gateway protocol(IGP)because it support routing


within one autonomous system only .
Features Of OSPF:It support multiple circuit load balancing.
It prevents the routing loops.
It can coverage very quickly to network topology change.
It supports variable length subnetting by including the subnet mask in the routing
message.
It improves scalabilty.
It introduces a 2 level hierarchy for improving scabality.it allows an AS to be
partitioned into several groups called area,that are interconnected by acentral backbone area.
An area is identified by a 32 bit number known as the area ID.
Type Of Routes In OSPF:Internal router: A router with its all links connected to the networks within the same
area.
Area border router:-A router that has its links connected to more than one area.
Backbone router:-A router that has its links connected to the backbone.
Autonomous system boundary router(ASBR):A router that has its links connected to another autonomous system.
OSPF header format:-

Version

Type
Router ID
Area ID

Packet length

Checksum

Authentication type
Authentication
Data

1)Version:-speifies the protocol version,current version OSPFV2.


2)Type:-indicates the messages type message type ie). A)hello b) database decription c) link
status d) link status update e)link status ACK.
3)Packet length:- specifies the length of OSPF packet in bytes.
4)Router ID:-identifies the sending router.
5)Area ID:-identifies the area this packet belongs to.
6)Checksum:-used to delect errors in the packet.
7)Authentication type:-identifies the type of the authentication.
8)Authentication:-indicates a value from the authentication type.

3.9 Subnetting:Motivation:To find some way to use the networks more efficiently.
Problem:Assigning many networks number has another drawback that becomes apparent when we
think about routing.
Big forwarding tables add costs to routers,they are potentially slower to search than smaller
tables for a given technology,so they degrade router performance.
Solution:Subnetting provides a first step to reduce total no of network number that are assigned.
Idea:-take a single IP networks number & allocate the IP addresses with that network number to
several physical networks.
Steps:-

1)the subnets should be close to each other.ie)having only one network number between
them.ie)a router will be able to select one route to reach any of the subnets.
From outside the campus ,all we need to know to reach any inside the campus is where the
campus connects to the internet.

3.9.1 Subnet mask:A single network number can be shared among mulitiple networks involves configuting all the
nodes on each subnet with a subnet mask. It enables a subnet number all hosts on the same
physical network will have the same subnet number ,which means that hosts may be different
physical networks but share a single network number.
Benefits of subnetting:1)Reduced network traffic.
2)Optimized network performance.
3) Simplified network management.
4)Facilities spanning large geographical distances.
The network administrator creates a 32 bit subnet mask comprised of one &zeros.
1 ->positions representing network or subnet addresses.
0->positions representing the host address.

Class

Format

Default subnet mask

Net.Node.Node.Node

255.0.0.0

Net.Net.Node.Node

255.255.0.0

Net.Net.Net.node

255.255.255.0

3.9.2 Masking:
It is a process that extracts the address of the physical network from an
IP address is called Masking.
There are two types of masking namely
1. Boundary level masking (either 0
or 255)
2. Non boundary level masking
(<255&>0)
Rules for Boundary Level:
Mask no 255, IP address is repeated
Mask no 0, 0 is repeated
Rules for Non-Boundary Level:
Mask no 255 ,IP address is repeated
Mask no 0, 0 is repeated.
Mask no (>0 & <255), do bitwise AND between mask number and IP address
Eg)
IP address----> 140.11.36.22 (Boundary level)
Mask ----------> 255.255.255.0
-------------------Subnet address

140.11.36.0
---------------------

IP address --------> 141.181.14.16 (Non Boundary level)

Mask -------------->255.255.224.0
------------------Subnet address

141.181.0.0
-------------------

224 ---->11100000
14 ----->00001110 (Bitwise AND)
--------------0------>00000000
-----------------

3.10 Network Address Translations:(NAT)


Every machine has a unique address of the form 10.X.Y.Z. When a packet leaves the
company, premises, it passes through the NAT box that convert the internal IP address 10.0.0.1
NAT box is often combined in a single device with a firewall.It is also possible to integrate the
NAT box into the company router.

LAN

Packet before transmission

1
2

10.0.0.1

198.60.42.12

3
4
5
6

ISP router
PC

Leased line

Server
NAT box

Boundary of company premises


Fig 3.32 NAT box into the company router

To support subnetting , the table must hold entries of the form.

<subnet number, Subnet Mask , NextHop>

The router ANDs the packets destination address with Subnet Mask for each entry. If the result
matches the subnet number of the entry , then this is the right entry to use and it forwards the
packets to the next hop router indicated.

3.11 CIDR: (Classless Interdomain Routing)


Subnetting has a counterpart, sometime called supernetting. It allows us to join several classful
addresses into a single Supernet.
Issues:
Address space efficiency and scalability of the routing system.
Solution:
Assign an appropriate number of class addresses to cover expected number of hosts. ie) The
length to indicate the network number.

The CIDR aggregates the routes. It tries to balance the desire to minimize the number of routes
that a router needs to know against the need to band out addresses efficiently.
It require a new type of notation to represent network numbers or prefixes as they are known
because the prefixes can be of any length.
Add /X after the address where X is the prefix length in bits.
Eg) 20 bit prefix for all the networks 194.4.16 through 192.4.31 is represented as 194.4.16/20
Advertise
128.112.128/2

ISP

128.112.128/2
44
128.112.129/2
4
128.112.130/2
4

128.112.135/2
4
Fig 3.33 Route Aggregation with CIDR

3.12 Interdomain Routing (BGP)


Autonomous System(AS)
It is used to provide an additional way to hierarchically aggregate routing information in a large
internet thus improving scalability.
Routing problem:
Inter domain routing (between AS)
Intra domain Routing (between AS)
Challenges in Inter Domain Routing
Routing policies
Loop prevention
Problems:
Implements a policy without any help from AS

Solution:
Keep the polices private.
Types of inter domain Routing Protocols:
BGP (Border Gateway protocol)
EGP(Exterior Gateway Protocol)
EGP is designed when the internet had a treelike topology. Since AS are connected only as
parents and children and not as peers.
BGP has no assumption about how AS are interconnected. They form an arbitrary graph. It is
enough to accommodate non-tree structured internetworks. Many internet service providers exist
to provide service to consumers. Interconnects other providers and larger corporations.
Types of Traffic:
Local traffic
Transit traffic
Local traffic: Originates (or) terminates on nodes within an AS
Transit traffic: Passes through an AS.
Types of Autonomous systems:
Stub AS
Multihomed AS
Transit AS
Stub AS : has only a single connection to other AS, it will carry local traffic.
Multihomed AS: has connection to more than one other AS but that refuses to carry transit
traffic
Transit AS : has connections to more than one other AS and is designed to carry both transit and
local traffic.
Goals of Inter Domain Routing:
Necessary to find some path to be intended destination that is loop free
Policy determination of Routing ie) Finding a non-looping, policy-complaint path
Additional Factors:
Scalability

Reachability
Issue of trust
Basics of BGP:
Each AS has one or more border routers through which packets enter and leave the AS. It is
known as Gateways.A border route is simply an IP router that is charged with the task of
forwarding packets between autonomous systems(AS)
Each AS also have atleast one BGP speaker.
BGP speaker duty:
Speak with other BGP speaker in other AS
Find that border routers
BGP advertises Complete paths as an enumerated list of AS to reach a particular network. It is
called as a path-vector protocol. The advertisement enables the sorts of policy decisions and
routing loops to be readily detected.
Large
Corporation

Peering point

Backbone
service provider
Consumer ISP

Small
Corporation

Peering point

Consumer ISP
Large
Corporation
Fig 3.34 A Simple Multi-Provider Internet

Many provides arrange to inter connect with each other at a single peering point.
Jobs of BGP:
To prevent the establishment of the looping paths.

Regional
Provider A (AS
2)

128.96
Customer P (AS
4)

Customer Q (AS 5)

Loop

Backbone n/w
(AS 1)

Customer R (AS
6)

Regional
Provider B (AS
3)

Customer S (AS
7)

Fig :3.35 A network running BGP & Loop among autonomous systems
The extra link (dashed line) between As2 and AS3 ,it has a loop in it. AS1 learns that it can reach
network 128.96 through AS2, so it advertises to AS3 , who in turn advertises it back to AS2. The
advertisement passes to AS3, then As3 is passed it to AS1, As1 is passed to AS2 and so on. The
loop will occur.(problem)
Solution:
BGP carries AS numbers to be unique. We note that a stub AS does not need a unique AS
number, because it will carry load traffic.
Path vector routing table:

Network

Next Router

path

N1

R01

AS14, AS2 , AS6

N2

R05

AS22, AS7 ,AS05

N3

R06

AS62, AS02, AS09

Types of messages:
Open
Update
Keepalive
Notification
Open to create neighbourhood relations IP and opens a TCP connection with a neighbour and
sends open message. Neighbour answers with a keep-alive message.
Update the path vector routing table by using 2 techniques
Local preference
BGP router advertise the local preference value, it will choose lighter
preference.
Multi exit discriminator
Entry point to forward and exit point for advertise. The area send the advertisements with
multi exit attribute go
Keepalive
BGP routers periodically inform each other about their presence. The maximum value is
1 sec
Notification
Send if a router wants to close or if it detects an error
BGP Packet Header:
All BGP packet share the same common header

15

23

MARKER

Length (16 bits)

Marker
Reserved for authentication

Type (8 bits)

31

Length
length of the packet and the size is 16 bits
Type
Specifies the type of the message size is 8 bits ie) update , keepalive , notification, open
message.

3.13 IPV6 (IP Version 6) :IP addresses are assigned not just to computers but also to mobile phones,television and others
household appliances. Since the IP address is carried in the headers of every IP
packet,increasing a need of the size of address dictates a change in the packet header.
Generation/Version of IP :-

1.IP next generation (IPng)


2.IP/IPv4
3.IPv6
Features/Motivation of IPv6 :1.Support for real-time services
2.Security services
3.Autoconfiguration
4.Enhanced routing functionality including support for mobile hosts.
When the new version (IPv6) introduced,it is impossible to shutdown
the entire hosts and routers,installed a new version of IP.

3.13.1 SIPP (Simple Internet Protocol Plus) :Doubling of the IP address size to 64bits.
IPV6 :Doubling of the SIPP address to 128 bits.
Address and Routing
IPv6 provides a 128bit address space
It can address 3.4*10^38 nodes

Assume the efficiency of address assignment is 100%


IPv6 predicted to provide over 1500 addresses per square foot of the
earths surface.
Address Space Allocation :IPv6 addresses are classless (CIDR),but the address space is still subdivided in various ways
based on the leading bits.
Table :Address Prefix Assignments for IPv6 :Prefix

Use

000..............0(128 bits)

Unspecified

000..............1(128 bits)

Loopback

1111 1111

Multicast address

1111 1110 10

Link-Local unicast

Everything else

Global Unicast Addresses

IP/IPv4

IPv6

Class A,B,C

Global Unicast Addresses

Class D

Multicast Address

Link-local Address :Use addresses to enable a host to construct an address that will work on the
network to which it is connected without being concerned about global unigueness of the
address.
Conversion of IPv4 to IPv6 :A node may be assigned on IPv4 compatible IPv6 address By ZERO-EXTENDING
a 32bit address (IPv4) to 128bits.It is called as IPv4 mapped IPv6 address
32 bits IPv4 + 2 bytes of + Zero 128 bits of
Address all is extending

IPv6 address

We can add 2 bytes of all 0s & 1s extending.But it is rarely used in network.

Address Notation :Standard Represending

x:x:x:x:x:x:x:x:x

Hexadecimal Representation of 16-bit piece of the address.

EX :47CD : 1234: 4422 : AC02 : 0022 : 1234 : A456 : 0124


An address with a large number of contiguous 0s can be written more compactly
by omitting all the 0 fields ,Thus
47CD : 0000 : 0000 : 0000 : 0000 : 0000 : A456 : 0124

47CD : : : : : : A456 : 0124


EX :IPv4 address : 128.96.33.81
IPv4 mapped

: : FFFF : 128.96 . 33 . 81

IPv6 address

3.13.2 Global Unicast Address :Idea :-

The unicast address allocation plan that determines how unicast address will be
assignes to service providers, autonomous system, network, hosts & routers
_ Assume that nontransit As as a subscriber & transit As as a provider. We may subdivide
providers into direct & indirect.
_ The former are directly connected to subscribers. It may correct other providers are not
connected directly to subscribers, are known as backbone network.

Goal :- To provide aggregation of routing information to reduce the burden on intra domain
routers.

Idea :- Use an address prefix a set of contiguous bits at the most significant end of the address
Way :- Assign an address prefix to a direct provide & then for that direct provider to assign
longer prefixes that begin with that prefix to its subscribers.

Problem :If a site decides to change providers, it will need to obtain a new address prefix &
renumber all nodes in the site.
Solution :Geographic addressing, in which a sites address is a function of its location rather than
the providers to which it attaches.
IPv6 Provider Based Unicast Address :Format :3

010

RegistryID

ProviderID

p
SubscriberID

125- m-n o-p


SubnetID

InterfaceID

Registry ID :IDs assigned to continents as countries.


EX :
When a (Customer) subscriber is connected to more than one provider, which prefix should
be subscriber use for their site ?
-If subscriber has prefix of
x

-Subscriber takes path


Prefix from

-Subscriber has both


Prefix X & Y

no relationshIP with
prefix Y

then Y advertise a
prefix, no relationship
it causes the half of
their site become unreachable

Packet Format :0
Version

12

16

Traffic Class

Payload Len

24
Flowlabel

Next header

31

Hoplimit

Source Address
Destination Address
Next header/data

1.Version :- Set to 6 for IPv6.


2. Traffic class & Flowlabel :- Relate to quality of service issues.
3. Payload len :- Length of the packet, excluding the IPv6 header measured in bytes
4. Next Header :- Replace both IP option & protocol field of IPv4
If options are required, then they are carried in one (or) more special headers following IP
Header.

IPv6 Fragmentation Extension Header :-

0
Next

16
Reused

29
Offset

31
RES

Header
Indentification
Next Header :-

- Value 44 assigned to indicate the fragmentation header.


- It does double duty,it may either identify the type of extension header to follow, or
in the last extension header.
- It serves as a demux key to identify the higher layer protocol running over IPv6.

5. Hop Limit :Simply the TTL of IPv4 maximum number of hop limits.
6. Source Address & Destination Address :The bulk of the header is taken up with the source & destination addresses, each of
which is 16 bytes (128 bits) long.
7. Next Header :Type of each extension header.
Auto Configuration :Requirements / Needs to Configure :- Valid IP address
- A subnet mask for the link to which it attaches
- Address of a name server.
* IPv6 support Plug-and-Play operation for auto configuration. It needs Stateless Auto
configuration, which needs does not require a server.
* IPv6 uni cast addresses are hierarchical, thus we can subdivide the auto configuration
problem into 2 parts.
1. Obtain an Interface ID ie) unique on the link to which the host is attached.
2. Obtain the correct address prefix for the subnet.
Advanced Routing Capabilities :- IPv6 defines an anycast address ie) assigned to a set of interfaces & packets sent to
that address will go to the nearest of those interfaces, determined by the routing protocols.
- Provide enhanced routing support to mobile hosts.
Other Features :1.Mobility
2.Network Security
3. New service model for the internet

3.14 CONGESTION AVOIDENCE IN NETWORK


LAYER :There are two mechanism which are used to avoid congestion in network layer.
DEC bit :The responsibility is divided between the routers & the end nodes.Each router
moniters the load & directly notifies the end nodes when congestion is about to occur.
Implementation :- Use a Binary Congestion bit in the packets that floe through the router.
- The destination host copies the congestion bit into the ACK, it sends back to the
source.
- The source adjusts its sending rate so as to avoid congestion.
- If the average queue
Length is

>= 1
Set this bit in packet

- Average queue length is measured over a time interval.

Queue Length

Averaging Interval

Current Time
Time
Previous cycle
Fig :3.36 Queue Length

Current cycle

Random Early Detection :-

- The router maintain a running average of their queue lengths.Each time a packet
arrives, this alignment computes the average queue length.
- The router discards one (or) more packets before the buffer becomes completely
full.
Average Queue Length

Congestion Level

Action to be taken

< Lower Threshold

Minimal (or)

Queue the packets

Non-existent

>Upper Threshold

High (or) Serious

Discard the packets

Between 2 Threshold

Onset of Congestion

Calculate the
Probability

Flow Control

Congestion Control

-It is done by server machine or sender - It is done by router


machine

- Buffering is used

- Buffering is not used

congestion

- It cant block the bandwidth of medium

- It block the bandwidth of medium

- Packet is lost between one sender & - Other user packet is also lost
receiver only
- It affects network performance highly
- It affects less on network perforance

You might also like