You are on page 1of 21

IT1571 – Computer Networks

Unit III
Part A
1. Outline the functions of ICMP.
2. How do routers differentiate the incoming unicast, multicast and broadcast IP
packets?
3. What is BGP?
4. What is multicast routing?
5. What are the two major mechanism defined to help transition from IP4 to IP6?

Part B
1. Dynamic Host Configuration Protocol
 Dynamic Host Configuration Protocol (DHCP) is a network management
protocol used to dynamically assign an IP address to any device, or node, on
a network so they can communicate using IP (Internet Protocol).
 It is an application layer protocol which is used to provide:
a. Subnet Mask (Option 1 – e.g., 255.255.255.0)
b. Router Address (Option 3 – e.g., 192.168.1.1)
c. DNS Address (Option 6 – e.g., 8.8.8.8)
d. Vendor Class Identifier (Option 43 – e.g., „unifi‟ = 192.168.1.9 ##where unifi
= controller)
 DHCP is based on a client-server model and based on discovery, offer, request,
and ACK.
 DHCP port number for server is 67 and for the client is 68.
 It is a Client server protocol which uses UDP services.
Message Format
Operations of DHCP

2. Distance Vector Routing Protocol


 A distance-vector routing (DVR) protocol requires that a router inform its
neighbors of topology changes periodically.
Bellman Ford Basics
 Each router maintains a Distance Vector table containing the distance between
itself and ALL possible destination nodes.
 Distances, based on a chosen metric, are computed using information from the
neighbors‟ distance vectors.
 Information kept by DV router
o Each router has an ID
o Associated with each link connected to a router, there is a link cost
(static or dynamic).
o Intermediate hops
 Distance Vector Table Initialization
o Distance to itself = 0
o Distance to ALL other routers = infinity number.

Algorithm
 A router transmits its distance vector to each of its neighbors in a routing
packet.
 Each router receives and saves the most recently received distance vector from
each of its neighbors.
 A router recalculates its distance vector when:
o It receives a distance vector from a neighbor containing different
information than before.
o It discovers that a link to a neighbor has gone down.
 The DV calculation is based on minimizing the cost to each destination
o Dx(y) = Estimate of least cost from x to y
o C(x,v) = Node x knows cost to each neighbor v
o Dx = [Dx(y): y ∈ N ] = Node x maintains distance vector Node x also
maintains its neighbors' distance vectors – For each neighbor v, x
maintains Dv = [Dv(y): y ∈ N ]
 Note –
 From time-to-time, each node sends its own distance vector estimate to
neighbors.
 When a node x receives new DV estimate from any neighbor v, it saves v‟s
distance vector and it updates its own DV using B-F equation:
o Dx(y) = min { C(x,v) + Dv(y), Dx(y) } for each node y ∈ N

Example
3. Link State Routing Protocol
 The term link-state to define the characteristic of a link (an edge) that
represents a network in the internet.
 In this algorithm the cost associated with an edge defines the state of the
link.
 Links with lower costs are preferred to links with higher costs; if the cost of a
link is infinity, it means that the link does not exist or has been broken.
 The collection of states for all links is called the link-state database (LSDB).

 Flooding - LS packet (LSP) - identity of the node and the cost of the link.

 Algorithm
4. Open Shortest Path First Protocol
 Open Shortest Path First (OSPF) is also an intradomain routing protocol
like RIP, but it is based on the link-state routing protocol
 In OSPF, like RIP, the cost of reaching a destination from the host is
calculated from the source router to the destination network.
 Each link (network) can be assigned a weight based on the throughput, round-
trip time, reliability, and so on.
 An administration can also decide to use the hop count as the cost.
Types of LSPs

Headers
5. Routing Information Protocol
 Intradomain routing protocols based on the distance-vector routing algorithm
 RIP is implemented as a process that uses the service of UDP on the well-
known port number 520.
 Two versions: RIP-1 and RIP-2
 Modification:
a. a router in an AS needs to know how to forward a packet to different
networks (subnets) in an AS
b. the cost is defined as the number of hops, which means the number of
networks (subnets) a packet needs to travel through from the source router to
the final destination host.
 Features:
a. Updates of the network are exchanged periodically.
b. Updates (routing information) are always broadcast.
c. Full routing tables are sent in updates.
d. Routers always trust routing information received from neighbor routers. This
is also known as Routing on rumors.
RIP Messages:

RIP Algorithm:
 If the received route does not exist in the old forwarding table, it should be
added to the route.
 If the cost of the received route is lower than the cost of the old one, the
received route should be selected as the new one.
 If the cost of the received route is higher than the cost of the old one, but the
value of the next router is the same in both routes, the received route should be
selected as the new one.
RIP Timers
 Update timer
 Invalid timer
 Hold down timer
 Flush timer
6. Border Gateway Protocol
 It is an interdomain routing protocol, and it uses the path-vector routing.
 It is a gateway protocol that is used to exchange routing information among
the autonomous system on the internet.

 Types
o External BGP (eBGP)
o Internal BGP (iBGP)
 Operation of External BGP

 Operation of Internal BGP


BGP Messages

7. Internet Protocol
 IP stands for internet protocol.
 It is a protocol defined in the TCP/IP model used for sending the packets from
source to destination.
 The main task of IP is to deliver the packets from source to the destination
based on the IP addresses available in the packet headers.
 IP defines the packet structure that hides the data which is to be delivered as
well as the addressing method that labels the datagram with a source and
destination information.

8. IPv4 vs IPv6
Ipv4 Ipv6
Address length IPv4 is a 32-bit address. IPv6 is a 128-bit address.
Fields IPv4 is a numeric address that consists of 4 IPv6 is an alphanumeric address that
fields which are separated by dot (.). consists of 8 fields, which are
separated by colon.
Classes IPv4 has 5 different classes of IP address IPv6 does not contain classes of IP
that includes Class A, Class B, Class C, addresses.
Class D, and Class E.
Number of IP IPv4 has a limited number of IP addresses. IPv6 has a large number of IP
address addresses.
VLSM It supports VLSM (Virtual Length Subnet It does not support VLSM.
Mask). Here, VLSM means that Ipv4
converts IP addresses into a subnet of
different sizes.
Address It supports manual and DHCP It supports manual, DHCP, auto-
configuration configuration. configuration, and renumbering.
Address space It generates 4 billion unique addresses It generates 340 undecillion unique
addresses.
End-to-end In IPv4, end-to-end connection integrity is In the case of IPv6, end-to-end
connection unachievable. connection integrity is achievable.
integrity
Security features In IPv4, security depends on the In IPv6, IPSEC is developed for
application. This IP address is not security purposes.
developed in keeping the security feature in
mind.
Address In IPv4, the IP address is represented in In IPv6, the representation of the IP
representation decimal. address in hexadecimal.
Fragmentation Fragmentation is done by the senders and Fragmentation is done by the
the forwarding routers. senders only.
Packet flow It does not provide any mechanism for It uses flow label field in the header
identification packet flow identification. for the packet flow identification.
Checksum field The checksum field is available in IPv4. The checksum field is not available
in IPv6.
Transmission IPv4 is broadcasting. On the other hand, IPv6 is
scheme multicasting, which provides
efficient network operations.
Encryption and It does not provide encryption and It provides encryption and
Authentication authentication. authentication.
Number of octets It consists of 4 octets. It consists of 8 fields, and each field
contains 2 octets. Therefore, the
total number of octets in IPv6 is 16.

Unit IV
Part A
1. List down the advantages of connection oriented services over connectionless
services.
2. How does UDP address flow control mechanism works?
3. Define congestion control.
4. What are the approaches used to provide a range of Quality of Service?
5. Difference between TCP and UDP.
Part B
1. User Datagram Protocol (UDP)
Introduction:
 UDP is a short form for User Datagram protocol. It is one of the simplest
transport layer protocols. It is a connectionless and unreliable transport
protocol.
 UDP packets, called user datagrams, have a fixed-size header of 8 bytes.
Operations of UDP:
1. Process to Process Communication
2. Connectionless Services
3. Encapsulation and decapsulation
4. Multiplexing and Demultiplexing
UDP checksum:
 UDP Checksum calculation is similar to TCP Checksum computation. It‟s also
a 16-bit field of one‟s complement of one‟s complement sum of a pseudo UDP
header + UDP datagram.
 Sender side:
o It treats segment contents as sequence of 16-bit integers.
o All segments are added. Let's call it sum.
o Checksum: 1's complement of sum.(In 1's complement all 0s are
converted into 1s and all 1s are converted into 0s).
o Sender puts this checksum value in UDP checksum field.
 Receiver side:
o Calculate checksum
o All segments are added and then sum is added with sender's checksum.
o Check that any 0 bit is presented in checksum. If receiver side
checksum contains any 0 then error is detected. So the packet is
discarded by receiver.
 Example:
o Suppose that we have the bit stream
0110011001100110 0110011001100110 0000111100001111:
o This bit stream is divided into segments of 16-bits integers.
 0110011001100110 (16-bit integer segment)
 0101010101010101
 0000111100001111
o The sum of first of these 16-bit words is:
 0110011001100110
 0101010101010101
−−−−−−−−−−−−−−−−−−−−−−
 1011101110111011

o Adding the third word to the above sum gives


 1011101110111011
 0000111100001111
−−−−−−−−−−−−−−−−−−−−−−
 1100101011001010 (sum of all segments)

 Now to calculate checksum 1's complement of sum is taken. So, the checksum
at sender side is: 0011010100110101.
 Now at the receiver side, again all segments are added .and sum is added with
sender's checksum.
 If no error than check of receiver would be: 1111111111111111.
 If any 0 bit is presented in the header than there is an error in checksum. So,
the packet is discarded.
 Although UDP provides error checking, it does not do anything to recover
from an error. Some implementations of UDP simply discard the damaged
segment; others pass the damaged segment to the application with a warning.
2. TCP state transition diagram for congestion management.
3. Quality of Service (QoS) Support in TCP
 Scheduling
o FIFO Queuing
o Priority Queuing
o Weighted Fair Queuing
 Resource reservation
 Traffic Shaping
o Leaky bucket
o Token bucket

4. TCP Flow control and Retransmission Techniques


Flow Control in TCP
 TCP uses an end-to-end flow control protocol to avoid having the sender
send data too fast for the TCP receiver.
 Sliding Window:
 In each TCP segment, the receiver specifies in the receive window field the
amount of additionally received data that it is willing to buffer for the
connection.
 The size of the window is determined by the lesser of two values: rwnd or
cwnd
o rwnd - It is the number of bytes the receiver can accept before its
buffer overflows.
o cwnd - It is the value determined by the network to avoid congestion.
Retransmission Technique
Original Algorithm
 Measure SampleRTT for each segment/ ACK pair
 Compute weighted average of RTT
o EstRTT = α x EstRTT + (1 - α )x SampleRTT
o α between 0.8 and 0.9 (typically 0.875)
 Set timeout based on EstRTT
o TimeOut = 2 x EstRTT
Problem:
 ACK does not really acknowledge a transmission
o It actually acknowledges the receipt of data
 When a segment is retransmitted and then an ACK arrives at the sender
o It is impossible to decide if this ACK should be associated with the first or
the second transmission for calculating RTTs
Karn/Partridge Algorithm
 Whenever TCP retransmits a segment, it does not take sample of RTT
 Double timeout after each retransmission
o Exponential backoff
Jacobson/Karels Algorithm
 Difference = SampleRTT − EstimatedRTT
 EstimatedRTT = EstimatedRTT + ( δ× Difference)
 Deviation = Deviation + δ(|Difference| − Deviation)
 TimeOut = EstimatedRTT + 4 × Deviation
 When the variance is small
o TimeOut is close to EstimatedRTT
 When the variance is large
o Deviation term dominates the TimeOut calculation
o δ is between 0 and 1

5. Explain congestion avoidance using random early detection in transport layer


with an example.
Introduction
 Random Early Detection (RED) reduces the congestion in queues by dropping
packets so that some of the TCP connections temporarily send fewer packets into the
network.
 Random: In order to avoid biases against bursty traffic and global synchronization,
RED uses randomization in choosing which arriving packets to drop or mark.
 Early: The “early” part of the RED acronym suggests that the router drops the packet
earlier than it would have to, so as to notify the source that it should decrease its
congestion window sooner than it would normally.
RED algorithm

Step 1: Average Length Calculation


avg = (1 – wq) x avg + wq x q
Step 2: Calculate Drop Probability
pb = maxp x (avg - minth)/(maxth - minth)
where
pa = pb/ (1 - count x pb)
Step 3: Decision Making
for each packet arrival
calculate the average queue size avg
if minth ≤ avg < maxth
calculate the probability pa
with probability pa:
mark the arriving packet
else if maxth ≤ avg
mark the arriving packet.

You might also like