CNModule 4
CNModule 4
Congestion : Too many packets present in the subnet causes congestion. It will result in the degradation of
performance.
Figure: When too much traffic is offered, congestion sets in and performance degrades sharply
When the number of packets dumped into the subnet by the hosts is within its carrying capacity, they are
all delivered and the number is proportional to the number sent.
However as traffic increases too far, the routers are no longer able to cope and they begin to lose packets.
This tends to make matters worse. At very high traffic, performance collapses completely and almost no
packets are delivered.
• Mismatch in the speed at which the packets are dumped into the router and the speed at
which they are delivered.
• Packets may arrive at four or more different lines are send out in single line which may
build up congestion. Here the solution is resources may be increased which can handle the
huge amount of data or the load can be deceased to avoid congestion. It can also be handled
by splitting the output into many lines.
Module 4
• Insufficient memory can also lead to congestion where the receiver router may not be able
to hold the incoming packets. But if we increase the memory then a queue might build up
for the packets and they have to wait for long before they get processed. Therefore the
packet delivery speed will be reduced.
• If there occurs a serious congestion spare routers may be kept to handle the congestion.
• Slow processor is another reason for congestion build up.
• Low bandwidth can also cause congestion.
Even though the term flow control and congestion control look same they are different. Congestion control
make sure the subnet is able to carry the offered traffic. Flow control make sure that a fast sender cannot
actually transmit data faster than the receivers ability to absorb it.
Congestion occurs as
• OPEN LOOP: control before the congestion occurs. Different methods are
o Retransmission policy
▪ Retransmits the data and timers kept to optimize efficiency.
o Window policy
▪ Selective repeat is used here than GoBackN
o Acknowledgement policy
▪ Does not acknowledge every packet
o Discarding policy
▪ The packets are discarded and they are not informed back to the sender to
avoid congestion. When the sender does not receive any acknowledgement
the same packets are send again.
o Admission policy
▪ Check the packets for the resource requirement of a flow before admitting to
the network.
• CLOSED LOOP:it detects the congestion,pass the information to where the action can be
taken and adjust the system to correct the problem(detect ,feedback,correct). Different
methods are
o Back pressure
▪ Inform the previous router to reduce the rate of outgoing packets
o Choke packet
▪ Packet send back to the sender to inform about the congestion.
o Implicit signaling
▪ Sender slows down the sending rate by detecting implicit signal concerning
congestion.
o Explicit signaling
▪ Backward or forward signaling done by packets send from congestion to
Module 4
• Transport Layer
o Retransmission policy
o Out of order caching policy
o Acknowledgement policy
o Flow control policy
o Timeout determination
▪ If the time out interval is too short extra packets will be sent unnecessarily. If
it is too long, congestion will be reduced .
• Network layer
o Virtual circuits versus datagrams in subnet
▪ Congestion control algorithms work only with virtual circuit subnets
o Packet queuing and service policy
▪ It relates to whether the routers have one queue per input line one queue per
output line or both. It also relates ot the order in which the packets are
processed.(e.g round robin or priority based.)
o Packet discard policy
Module 4
▪ It tells which packet is dropped . a good policy can help alleviate congestion
and a bad one can make it worse.
o Routing algorithm
Prepared by Ms. Nasreen Ali, AP CSE 3
Dept. of CSE,ICET CS306 COMPUTER NETWORKS
▪ Good routing algorithm can avoid congestion by spreading the traffic all over
the line and abad one can send too much traffic over already congested lines.
o Packet lifetime management
▪ Deals with how long a packet may live before being discarded. If life time is
too long lost packets may clog the network, but if it is too short, packets may
time out before reaching destination thus inducing retransmission.
• Data link Layer
o Retransmission policy
• Concerned with how fast a sender times out and what it transmits upon
timeout. Selective repeat or GoBackN can be used for retransmission.
o Out of order caching policy
o Acknowledgement policy
• Here the acknowledgements are saved for a group of packets and
piggybacked onto reversed traffic.
o Flow control policy
• Tight flow control may be implemented by using small window may help
flow control.
Figure: a) A congested subnet b)a redrawn subnet that eliminates the congestion. A virtual
circuit from A to B is also shown
• Another strategies used are volume control; Quality of Service is ensured and other parameters.
• It might keep the resources (tables, buffer, and bandwidth) reserved. This might lead to wastage of
resources.
• Each router monitors the utilization of the output lines and resources using the formula
Unew= aUold+(1-a)f where a is constant,u is utilization value between 0 and 1.0,f instant line
utilization either 0 or 1.
Module 4
Warning Bits
Prepared by Ms. Nasreen Ali, AP CSE 4
Dept. of CSE,ICET CS306 COMPUTER NETWORKS
Choke Packets
• To slow down the sending rate of packets by the source the choke packets are used.
• When choke packets are received the source traffic is reduced by X%.
• When the choke packets are received the sender will stop sending the packets for a while. After that
it will restart the transmission. After that if the choke packet is again received the host will again
cut short the packets. If no choke packet arrives the host may increase rate of transmission.
• Problem with the choke packet is that for high speed WANs return path for choke packet may be so
long that too many packets have already been send by the source before the source notes congestion
and takes no action.
• Solution for this is use PUSH-BACK or hop-by-hop choke packets.
HOP-BY-HOP packet
• It works as follows
o The router sends choke packets to the source host
o The immediate neighbor of the router get information about the traffic congestion
o It sends back the choke packet after updating its data rate by reducing the data rate.
o All the routers getting choke packets reduce their data rates immediately without waiting for
the original source to reduce the data rate.
Module 4
Figure: a) A choke packet that affects only the source. B) A choke packet that affects
each hop it passes through
Prepared by Ms. Nasreen Ali, AP CSE 5
Dept. of CSE,ICET CS306 COMPUTER NETWORKS
Load Shedding
• Here the router will drop the packets but which one to drop will be decided by the router.
• Which packet to discard depend on the application running
o Wine policy: for file transfer old packet is worth than a new one. Here dropping old packet
may cause more packets to be retransmitted which may cause congestion.
o Milk Policy: for multimedia data a new packet is more important than old one. Thus fresher
is better.
• This is an approach where the router discards one or more packets before the buffer becomes
completely full.
• Each time a packet arrives , the RED algorithm computes the average queue length. When the
average queue length on some lines exceeds threshold the line is said to be congested and action is
taken.
• If average queue length is lower than threshold, the congestion is assumed to be minimal or non
existant and the packet is queued.
• If average queue length is higher than threshold, congestion is assumed to be serious and the packet
is discarded.
• If the average queue length is between the two thresholds, this might indicate the oneset of
congestion. The probability of congestion is then calculated.
Jitter Control
Quality of Service(QoS)
Module 4
• A stream of packets from a source to destination is called a flow. In a connection oriented network
all packets belonging to a flow, follow the same route; in a connection less service they may follow
different routes.
• The needs of each flow can be characterized by primary parameters namely reliability, delay, jitter
and bandwidth. Together these determine the QoS the flow requires.
Flow Characteristics
1. Over provisioning
a. Gives more router capacity, buffer space and bandwidth so that packets fly through easily.
But it’s expensive
2. Buffering
a. Data is buffered here. For example in video play the data can be initially fully buffered and
the video can be played. This will avoid the jitter related with it.
a. First all packets to the same route and flown in one direction. Then the resources are
reserved. Commonly used resources are bandwidth, buffer space and CPU cycles are used
as resources.
7. Admission control
a. Incoming traffic from some flow is well shaped and can potentially follow a single route in which
capacity can be reserved in advance on the routers along the path.
b. When such a flow is offered to a router, it has to decide, based on its capacity and how many
commitments it has already made for other flows, whether to admit or reject the flow.
c. The decision to accept or reject a flow is not a simple matter of comparing the (bandwidth, buffers
and cycles) requested by the flow with the router's excess capacity in those three dimensions. A set
of such parameters is called a flow specification. Typically, the sender (e.g., the video server)
produces a flow specification proposing the parameters it would like to use. As the specification
propagates along the route, each router examines it and modifies the parameters as need be. The
modifications can only reduce the flow, not increase it (e.g., a lower data rate, not a higher one).
When it gets to the other end, the parameters can be established.
8. Proportional Routing
a. Most routing algorithms try to find best paths for each destination and send all traffic to that
destination over the best path.
9. Packet Scheduling
a. Fair queuing algorithm used here
b. The essence of the algorithm is that routers have separate queues for each output line, one for
each flow. When a line becomes idle, the router scans the queues round robin, taking the first
packet on the next queue. In this way, with n hosts competing for a given output line, each
host gets to send one out of every n packets. Sending more packets will not improve this
fraction.
Module 4
Module 4
Module 4
Module 4
Integrated services
Figure: a) A network b) Multicast spanning tree for host 1 c) Multicast spanning tree for host 2
An example of such a reservation is shown in figure. Here host 3 has requested a channel to host 1. Once it
has been established, packets can flow from 1 to 3 without congestion. Now consider what happens if host 3
next reserves a channel to the other sender, host 2, so the user can watch two television programs at once. A
second path is reserved, as illustrated in figure (b). Note that two separate channels are needed from host 3
to router E because two independent streams are being transmitted.
Module 4
Finally, in figure:c, host 5 decides to watch the program being transmitted by host 1 and also makes a
reservation. First, dedicated bandwidth is reserved as far as router H. However, this router sees that it already
has a feed from host 1, so if the necessary bandwidth has already been reserved, it does not have to reserve
any more. Note that hosts 3 and 5 might have asked for different amounts of bandwidth (e.g., 3 has a black-
and-white television set, so it does not want the color information), so the capacity reserved must be large
enough to satisfy the greediest receiver.
Differentiated Services
• Assured Forwarding : 12 different service classes are used. There are three possibilities for
discarding a packet(Low,Medium,High).
• Procedure is as follows
o First determine the capacity of the routers
o During high loads low priority packets are discarded
o By suitable selection of probabilities lower priority level is still forwarded, while packets are
discarded.
IP Addressing
• The identifier used in the IP layer of the TCP/IPprotocol suite to identify each device connected to
the Internet is called the Internet address or IP address.
• An IP address is a 32-bit address that uniquely anduniversally defines the connection of a host or a
router to the Internet.
• The address space in a protocol that uses N-bits to define an Address is: 2N
• The address space of IPv4 is 232 or 4,294,967,296.
• Three common notations to show an IP address:
o Binary Notation
o Dotted Decimal Notation
o Hexadecimal Notation
• Binary Notation
o In binary notation IP address is displayed as 32 bits.
o To make address more readable, one or more space is usually inserted between each octet.
o IP address is also referred as 32 bit address, a 4 octet address or a 4- byte address.
o Eg:01110101 10010101 00011101 11101010
• Dotted-decimal notation
o Internet addresses are usually written in decimal form with a decimal point separating the
bytes.
o Each number in the dotted- decimal notation is between 0 and 255.
• Hexadecimal Notation
o Each hexadecimal digit is equivalent to four bits.
o So a 32- bit address has 8 hexadecimal digits.
o This notation is used in network programming.
o Ex.
1100001 10000011 00011011 11111111 can be represented as
OXC1831CFF or C1831CFF16
75 95 1D EA
0x75951DEA
Module 4
CLASSFULADDRESSING
• In classful addressing, the IP address space is divided into five classes: A,B,C,D and E.
• Each part occupies some part of the whole address space.
• In classful addressing, an IP address in classes A,B and C is divided into netid and hostid.
•
Module 4
One problem with classful addressing is that each class is divided into fixed number of blocks with
each block having a fixed size.
Class A
Class A is divided into 128 blocks with each block having different net id.
The first block covers addresses from 0.0.0.0 to 255.255.255 (netid 0)
Each block of addresses the first addresses is same, but the other 3 bytes can take any value.
The first and last blocks in this class are reserved for special purposes.
One block (netid 10) is used for private addresses.
The remaining 125 blocks can be assigned to organizations.
• The first address in the block is used identify the organization to the rest of internet. This address is
called network address.
• Class A addresses were designed for large organizations
• Millions of Class A addresses are wasted.
Class B
Class B is divided into 16,384 blocks with each block having different netid.
16 blocks are reserved for private addresses, remaining 16368 blocks can be assigned to
organizations.
For each block the first two bytes (netid) are same.
Class B addresses were designed for mid- sized organizations that may have ten thousands of host or
routers.
Module 4
The no: of addresses in each block is 65,536, is larger than needs of most organizations.
So many Class B addresses are wasted.
Class C
Class C is divided into 2,097,152 blocks with each block having different netid.
256 blocks are reserved for private addresses, leaving 2,096,896 blocks can be assigned to
organizations.
Each block in this class has 256 addresses, which means the organizations should be small enough to
need less than 256 addresses.
Class C addresses were designed for small organizations with a smaller number of hosts or routers.
The number of addresses in Class C is smaller than the needs of most organizations
Class D
Class E
Network Addresses
Network address
o The first address in a block defines the network address
Module 4
Module 4
Loopback address
o It is used test the software on a machine.
Module 4
Private Address
o A number of blocks in each class are assigned for private use
CLASSLESS ADDRESSING
In the mid of 1990s, a range of addresses meant a block of addresses in class A,B, or C.
The minimum number of addresses granted to an organization was 256 (class C).
An ISP is an organization that provides Internet addresses to individuals.
Classless addressing, announced in 1996, allows an ISP to assign as few or as many IP addresses as
requested.
In classless addressing the entire 2^32 address space is divided into variable-sized blocks, which are
multiples of powers of 2.
The first address must be evenly divisible by the number of addresses. For example, if a block
contains 4 addresses, the first address must be divisible by 4.
Module 4
Mask
When an organization is given a block, it is given the first address and the mask.
The mask is made of some 1s at left followed by some 0s at right.
So instead of mask 255.255.255.224, we can say that the mask has 27 1s.
This number is attached at the end of classless address. This is called slash notation or CIDR notation
(Classless Inter Domain Routing).
Prefix – another name for the common part of the address range (netid)
Prefix lengths
• In subnetting, a network is divided into smaller subnetworks with each subnet having its own subnet
address
• In supernetting, a organization can combine several class C to create a large range of addresses. In
Module 4
• Generally: class A, B, C → two levels of hierarchy. Sometimes two levels is not enough
Prepared by Ms. Nasreen Ali, AP CSE 24
Dept. of CSE,ICET CS306 COMPUTER NETWORKS
• Solution - subnetting
Module 4
Masking
A process that extracts the address of the physical network from IP address
Can be done whether we have subnet or not.
Not have subnet: masking extract the network address from an IP address.
Have subnet: masking extract the subnet address from IP address.
Subnet Mask
A 32 bit number used for masking
Part of masking containing 1s defines netid orcombination of netid and subnetid
Part of making containing 0s defines hostid
To get the network and subnet address, we must apply the bit-wise-and operation on
IP address and the mask
Subnetting
In subnetting, add bits from the host part to network part to define subnet address
Module 4
Designing Subnets
• Deciding the number of subnets
The number of subnets must be a power of 2
Variable-length subnetting
– Then it applies the second mask with 27 1s (255.255.255.224) to one of the subnets to
divide it into two smaller subnets
Supernetting
Assigning addresses
1. choose the blocks randomly based on some rules if do so, the routers outside the organaization treat
each block separately
Prepared by Ms. Nasreen Ali, AP CSE 28
Dept. of CSE,ICET CS306 COMPUTER NETWORKS
2. Make a superblock out of the block, so that each routing table has only one entry in the table follow
a set of rules
III. The third byte of the first address in the superblock must be evenly divisible by the number of blocks
Supernet mask
In supernetting, need the first address of the supernet and the supernet mask to define the range of
addresses.
Comparison of subnet, default, and supernet masks
Example :
We need to make a supernetwork out of 16 class C blocks. What is the supernet mask?
Solution:
We need 16 blocks. For 16 blocks we need to change four 1s to 0s in the default mask. So the mask
is
11111111 11111111 11110000 00000000
or
255.255.240.0
Module 4
Example :
A supernet has a first address of 205.16.32.0 and a supernet mask of 255.255.248.0. How many
blocks are in this supernet and what is the range of addresses?
Solution:
The supernet has 21 1s. The default mask has 24 1s. Since the difference is 3, there are 2 3 or 8 blocks
in this supernet. The blocks are 205.16.32.0 to 205.16.39.0. The first address is 205.16.32.0. The last
address is 205.16.39.255.
IPv4 PacketFormat
• Version: IP Version
• 4 for IPv4
• HLen: Header Length
• 32-bit words (typically 5)
• TOS: Type of Service
• Priority information Module 4