0% found this document useful (0 votes)
15 views170 pages

Unit 3 - Netwok and Internetworking

Uploaded by

21ag1a05h2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views170 pages

Unit 3 - Netwok and Internetworking

Uploaded by

21ag1a05h2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 170

The Network Layer

Network Layer Design Issues

• Store-and-Forward Packet Switching


• Services Provided to the Transport Layer
• Implementation of Connectionless Service
• Implementation of Connection-Oriented Service
• Comparison of Virtual-Circuit and Datagram Subnets
Store-and-Forward Packet Switching
(The context in which network layer works)

 A host with a packet to send transmits it to the nearest router, either on its own
LAN or over a point-to-point link to the ISP.
 The packet is stored there until it has fully arrived and the link has finished its
processing by verifying the checksum.
 Then it is forwarded to the next router along the path until it reaches the
destination host, where it is delivered.
 This mechanism is store-and-forward packet switching,
Services Provided to the Transport Layer
 The network layer provides services to the transport layer at
the network layer/transport layer interface.
 An important question is what kind of services the network
layer provides to the transport layer.
 The network layer services have been designed with the
following goals in mind:
1. The services should be independent of the router
technology.
2. The transport layer should be shielded from the number,
type, and topology of the routers present.
3. The network addresses made available to the transport
layer should use a uniform numbering plan, even across
LANs and WANs.
Services Provided to the Transport Layer

 Two types of services can be offered by network layer


1. Connectionless: datagram networks
2. Connection‐oriented: virtual circuit networks

 Data networks - X.25 1970s


Frame Relay 1980s,
ATM – 1980
were connection-oriented.

 Two examples of connection-oriented technologies are


MPLS (MultiProtocol Label Switching), and VLANs.

 ARPANET and The IP protocol were connectionless


networks
Implementation of Connectionless Service
 No connection setup
 Message is broken into packets called datagrams –
network is called datagram network
 Each packet is individually routed
 Routers decides line based on routing table
 Packets may follow different paths
 Not guaranteed to arrive in order
 The algorithm that manages the tables and makes the
routing decisions is called the routing algorithm.
Implementation of Connectionless Service
Implementation of Connectionless Service

Network
A connectionless
packet-swtiched network
R1 R2
4 3 2 1 2

Sender 1
Network
4
2
3
R4 1
3 3
4 1 3 4 2
R3 R5 Out of order Receiver
Implementation of Connection-Oriented Service
 Path from source to destination must be established
before any data can be sent
 Connection is called a VC (virtual circuit) – network
is called virtual circuit network
 Avoid choosing new route for each packet
 Same route used for all packets in connection
 Each packet has ID for which VC it belongs to
 This process is called label switching.
An example of a connection-oriented network service
is MPLS (MultiProtocol Label Switching).
Implementation of Connection-Oriented Service

Routing within a virtual-circuit subnet.


Figure A virtual-circuit packet-switched network

18.11
Connection‐Oriented or Connectionless?
Two competing camps

Internet community: connectionless


 routers job is moving packets and nothing else
 subnet is inherently unreliable
 hosts should provide error & flow control

Telephone companies: connection‐oriented


 subnet should provide reliable service
 successful experience with telephone system
 without connections, QoS is hard to achieve
Comparison of Virtual-Circuit and
Datagram Subnets

5-4
Routing Algorithms
• The main function of the network layer is routing packets
from the source machine to the destination machine.

• The routing algorithm is part of the network layer


software responsible for deciding which output line an
incoming packet should be transmitted on.
i. Datagram networks – dynamic path
ii. Virtual circuit networks – virtual path – session
routing
Routing Algorithms
There are two processes inside router:

a) One of them handles each packet as it arrives, looking up


the outgoing line to use for it in the routing table. This
process is forwarding.

b) The other process is responsible for filling in and updating


the routing tables. That is where the routing algorithm
comes into play. This process is routing.
Routing Algorithms
Regardless of whether routes are chosen independently for
each packet or only when new connections are established,
certain properties are desirable in a routing algorithm:
 Correctness
 Simplicity
 Robustness – handles failures(devices, topology change)
 Stability – equilibrium (in failures)
 Fairness and Optimality - Minimizing the mean packet
delay
Routing Algorithms
Routing Algorithms
Routing algorithms can be grouped into two major classes:
1. Nonadaptive (static routing)
2. Adaptive(Dynamic routing)

• Nonadaptive algorithm do not base their routing decisions


on measurements or estimates of the current traffic and
topology.

The choice of the route to use to get from I to J is computed


in advance, off line, and downloaded to the routers when the
network is booted. This procedure is sometimes called static
routing.
Routing Algorithms
Adaptive algorithm, changes routing decisions to reflect
changes in the topology, and usually the traffic as well.

Adaptive algorithms differ in


where they get their information (e.g., locally, from adjacent
routers, or from all routers),
when they change the routes (e.g., every ΔT sec, when the
load changes or when the topology changes),
what metric is used for optimization (e.g., distance, number
of hops, or estimated transit time).
This procedure is called dynamic routing.
Routing Algorithms
• The Optimality Principle
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State Routing
• Hierarchical Routing
• Broadcast Routing
• Multicast Routing
• Routing for Mobile Hosts
• Routing in Ad Hoc Networks
The Optimality Principle
One can make a general statement about optimal routes
without regard to network topology or traffic.

•This statement is known as the optimality principle.

•It states that if router J is on the optimal path from router I to


router K, then the optimal path from J to K also falls along
the same route.
The Optimality Principle

(a) A subnet. (b) A sink tree for router B.


The Optimality Principle
As a direct consequence of the optimality principle, we can
see that the set of optimal routes from all sources to a
given destination form a tree rooted at the destination.

• Such a tree is called a sink tree.

• The goal of all routing algorithms is to discover and use the


sink trees for all routers.

• If we allow all of the possible paths to be chosen, the tree


becomes a more general structure called a DAG (Directed
Acyclic Graph).
Shortest Path Routing
The idea is

 Build a graph of network


 Each node represent a router
 Each edge or arc represent a communication line or link
 Find shortest path between the two nodes - routers (To
choose a route between a given pair of routers, the
algorithm just finds the shortest path between them on the
graph.)
Shortest Path Routing
To find shortest path (fastest path) - Each edge is labeled
with a weight
 number of hops
 geographic distance
 mean queuing/transmission delay of test packet(hourly
runs)
 Bandwidth
 Communication cost
 Average traffic
Shortest Path Routing

Dijkstra’s Algorithm
 Finds shortest paths from given source node to all other
nodes
 Develops paths in order of increasing path length
 Runs in stages, each time adding node with next shortest
path
 Algorithm terminates when all nodes processed by
algorithm (in set T-tentitive)
Shortest Path Routing - Dijkstra’s Algorithm
Shortest Path Routing - Dijkstra’s Algorithm

The first 5 steps used in computing the shortest path from A to D.


The arrows indicate the working node.
Shortest Path Routing - Dijkstra’s Algorithm
Shortest Path Routing - Dijkstra’s Algorithm
Shortest Path Routing - Dijkstra’s Algorithm

Dijkstra's algorithm to compute the shortest path through a graph.


Shortest Path Routing - Dijkstra’s Algorithm

Dijkstra's algorithm to compute the shortest path through a graph.


Flooding
 When a routing algorithm is implemented, each router must make
decisions based on local knowledge, not the complete picture of the
network.
 A simple local technique is flooding, in which every incoming
packet is sent out on every outgoing line except the one it arrived
on.

 Send every packet to all lines except the one it arrived on


 Large number of duplicate packets
 Should use counter to prevent infinite duplicates
 Should use sequence numbers to identify duplicates
 Will always find shortest path
Flooding
Applications
 Military applications
 Distributed database systems
 Wireless stations use it by nature
 Metric for other algorithms (e.g. delay)
Dynamic Routing Algorithms
1. Distance Vector Routing

2. Link State Routing


Distance Vector Routing – Bellman Ford
Routing Algorithm
 Distance Vector Routing algorithm operates by having each router
maintains a table containing two parts:
• Destination - best known distance to that destination
• Outgoing line used to get there

 Uses Bellman-Ford algorithm

 Used in ARPANET and now used in internet as RIP

 Distance can be any metric: delay, hop count, queue length, etc.
Distance Vector Routing – Bellman Ford
Routing Algorithm
 As an example, assume that delay is used as a metric and that the
router knows the delay to each of its neighbors.
 Once every T msec each router sends to each neighbor a list of its
estimated delays to each destination.
 It also receives a similar list from each neighbor.
 The routing tables are updated by exchanging information with the
neighbors.
 Router X estimates delay to router Z
• Router Y is a neighbor to router X
• D(X,Z) =D(X,Y)+ D(Y,Z)

 The settling of routes to best paths across the network is called


convergence.
Distance Vector Routing – Bellman Ford
Routing Algorithm

(a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.
Distance Vector Routing – Bellman Ford
Routing Algorithm
The count-to-infinity problem.
Distance Vector Routing – Bellman Ford
Routing Algorithm
The count-to-infinity problem.

After A Failure
Before A Failure
Distance Vector Routing – Bellman Ford
Routing Algorithm
Solutions for the count-to-infinity problem.

 Defining infinity: To redefine infinity to a smaller number, such as 100.


Distance vector protocol define the distance between each node to
be 1 and define 16 as infinity. However, this means that the
distance vector routing cannot be used in large systems. The size
of the network, in each direction, can not exceed 15 hops.

 Split horizon: Instead of flooding the table through each interface,


each node sends only part of its table through each interface. Node B
eliminates the last line of its routing table before it sends it to A

 Split horizon and poison reverse: Node B can still advertise the
value for X, but if the source of information is A, it can replace the
distance with infinity as a warning: “Do not use this value, what I know
about this route comes from you.”
Distance Vector Routing – Bellman Ford
Routing Algorithm
Two primary problems caused distance vector routing’s
demise.
1. First, since the delay metric was queue length, it did not take
line bandwidth into account when choosing routes.
2. Second, the algorithm often took too long to converge (the
count-to-infinity problem)

It was replaced by an entirely new algorithm, now called link state


routing.
Link State Routing
Each router construct the topology of the entire configuration
and calculates the shortest path to each destination network.

Each router must do the following:


1. Discover its neighbors, learn their network address.

2. Measure the delay or cost to each of its neighbors.

3. Construct a packet telling all it has just learned.

4. Send this packet to all other routers.

5. Compute the shortest path to every other router.


Link State Routing
Learning about the Neighbors
 Send HELLO packet on point-to-point lines – gets replay
 If routers are connected to a LAN, the LAN can be represented as a
node

(a) Nine routers and a LAN. (b) A graph model of (a).


Link State Routing
Measuring Line Cost
Each link must have a distance or cost metric for finding shortest paths.
The cost to reach neighbors can be set automatically, or configured by
the network operator.
A common choice is to make the cost inversely proportional to the
bandwidth of the link.
For example, 1-Gbps Ethernet may have a cost of 1 and 100-Mbps
Ethernet a cost of 10. This makes higher-capacity paths better choices.
For networks spread geographically
Send ECHO packet
Wait for response
Measure round-trip-time
Link State Routing
Building Link State Packets

(a) A subnet. (b) The link state packets for this subnet.
Link State Routing
Distributing the Link State Packets

 Use flooding
 Packet contains sequence number
 When packet is received
– If new, forward to all except coming from
– If duplicate, discard
– If old, rejected
Link State Routing
Distributing the Link State Packets

The packet buffer for router B in the previous slide (Fig. 5-13).
Link State Routing
Computing the New Routes

 Once a router has accumulated a full set of link state packets, it can
construct the entire network graph because every link is represented.
 Every link is, in fact, represented twice, once for each direction.
 The shortest-path computations may then find different paths from router
A to B than from router B to A.
 Now Dijkstra’s algorithm can be run locally to construct the
hortest paths to all possible destinations.
Link State Routing
 Link state routing is widely used in actual networks.

 Many ISPs use the IS-IS (Intermediate System-Intermediate


System) link state protocol (Oran, 1990).

 It was designed for an early network called DECnet, later adopted by


ISO for use with the OSI protocols and then modified to handle other
protocols as well, most notably, IP.

 OSPF (Open Shortest Path First) is the other main link state
protocol.
Hierarchical Routing
Problems in DVR and LINK State Routing
 Routing tables grow with network size
 More router memory
 More CPU time to scan them
 More bandwidth to send updates
 For large networks, better to do routing hierarchically
 Hierarchy can be in multiple levels
– Regions into
– Clusters into
– Zones into
– groups … follows upto final aggregation then construct
the routing tables.
Hierarchical Routing

Hierarchical routing (c) routing table based on regions.


Hierarchical Routing
Kamoun and Kleinrock (1979) discovered that the
optimal number of levels for an N router
network is log N, requiring a total of e log N
entries per router.
Broadcast Routing
 Sending a packet to all destinations simultaneously is called
broadcasting.
 For example, a service distributing weather reports, stock market
updates, or live radio programs

Some broadcasting methods


 Send one packet to each destination?
wasteful of bandwidth
require having complete list of destinations
Broadcast Routing
Some broadcasting methods
Multi-destination routing
 packet contain list of destinations or bit map indicating desired
destinations
 When a packet arrives at a router, the router checks all the
destinations to determine the set of output lines that will be
needed.
 The router generates a new copy of the packet for each output
line to be used and includes in each packet only those
destinations that are to use the line.
 the source needs to know all the destinations.

Flooding
generates too many packets, waste bandwidth
Broadcast Routing - Reverse Path Forwarding
Solution :
Reverse Path Forwarding - (Dalal and Metcalfe, 1978).
Idea
 When a broadcast packet arrives at a router, the router checks to see if the packet
arrived on the link that is normally used for sending packets toward the source
of the broadcast.
 If so, there is an excellent chance that the broadcast packet itself followed the best
route from the router and is therefore the first copy to arrive at the router.
 This being the case, the router forwards copies of it onto all links except the one it
arrived on.
 If, however, the broadcast packet arrived on a link other than the preferred one for
reaching the source, the packet is discarded as a likely duplicate.
Broadcast Routing - Reverse path forwarding

Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The
tree built by reverse path forwarding.
Broadcast Routing - Reverse path forwarding
Broadcast Routing - Reverse path forwarding

Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The
tree built by reverse path forwarding.
Broadcast Routing - Reverse path forwarding
First hop: I sends 4 packets to F, H, J, and N
•each of these arrives on the preferred path to I
•so, indicated by circle; forwarded
Second hop: 8 packets are generated
•all 8 arrive at previously unvisited routers
•5 of these arrive along preferred line
Third hop: 6 packets generated
•only 3 arrive at preferred path (C, E, K)
•others are duplicates (copies); discarded
Fourth hop: 4 packets generated
•2 arrive at preferred lines (B, L); forwarded
•2 are duplicates; discarded
Fifth hop: 2 packets generated
•2 are duplicates; discarded
•no more forwarded packets
Total: 24 packets, 5 hops
Broadcast Routing – Spanning Tree
The Broadcast algorithm improves on the behavior of reverse path
forwarding is sink tree or spanning tree.
 It makes explicit use of the sink tree—or any other convenient
spanning tree—for the router initiating the broadcast.
 A spanning tree is a subset of the network that includes all the routers
but contains no loops.
 Sink trees are spanning trees.
 If each router knows which of its lines belong to the spanning tree, it
can copy an incoming broadcast packet onto all the spanning tree
lines except the one it arrived on.
 This method makes excellent use of bandwidth, generating the
absolute minimum number of packets necessary to do the job.
 when the sink tree of part (b) is used as the spanning tree, the
broadcast packet is sent with the minimum 14 packets.
Multicast Routing
Multicasting
 sending message to a group of nodes
 routing algorithm called multicast routing
Why multicasting?
 distributed processing
 broadcasting is inefficient, sometimes insecure
Multicasting Require group management
 create, destroy groups
 processes to join, leave groups
Multicast Routing
Multicast Routing
Multicast Routing
Multicast Routing
Multicast Routing

(a) A network. (b) A spanning tree for the leftmost router.


(c) A multicast tree for group 1. (d) A multicast tree for group 2.
Multicast Routing

(a) A network. (b) A spanning tree for the leftmost router.


(c) A multicast tree for group 1. (d) A multicast tree for group 2.
Multicast Routing
For a network has n groups, each with an average of m nodes. At
each router and for each group, m pruned spanning trees must be
stored, for a total of m*n trees.

1. MOSPF (Multicast OSPF) is an example of a link state protocol


that works on knowledge of entire topology(Moy, 1994).
2. DVMRP (Distance Vector Multicast Routing Protocol) is an
example of a multicast routing protocol that works on idea of reverse
path forwarding(Waitzman et al., 1988).
3. An alternative design uses core-based trees to compute a single
spanning tree for the group (Ballardie et al., 1993). All of the routers
agree on a root (called the core or rendezvous point) and build the
tree by sending a packet from each member to the root. The tree is
the union of the paths traced by these packets.
4. PIM (Protocol Independent Multicast)
Multicast Routing
core-based trees
Anycast Routing
1. In anycast, a packet is delivered to the nearest member of a
group. (Partridge et al., 1993).
2. Schemes that find these paths are called anycast routing.
3. Anycast is used in the Internet as part of DNS.
4. Distance vector and link state routing can produce anycast routes
Routing for Mobile Hosts
Mobile Hosts: not sationary i.e., moving in network. eg: Cellular
phones , laptops , (in buses, rails, airplane)

Challenge:
 To route a packet to a mobile host, the network first has to find it.

The model assumes:


 all hosts have a permanent home location that never changes i.e.
permanent address, even though they move.

 The routing goal in systems with mobile hosts is to make it


possible to send packets to mobile hosts using their fixed home
addresses and have the packets efficiently reach them wherever they
may be. The trick, of course, is to find them.
Routing for Mobile Hosts
Mobile Routing - Triangle Routing

i. The basic idea used for mobile routing in the Internet and cellular
networks is for the mobile host to tell a host at the home location
where it is now.
ii. This host, which acts on behalf of the mobile host, is called the
home agent.
iii. Once it knows where the mobile host is currently located, it can
forward packets so that they are delivered.
Routing for Mobile Hosts - Triangle Routing

Figure: Packet routing for mobile hosts.


Routing for Mobile Hosts - Triangle Routing
Step 1:
The local address is called a care of address. Once the mobile host has
this address, it can tell its home agent where it is now. It does this
by sending a registration message to the home agent with the care of
address.
Step 2:
The sender sends a data packet to the mobile host using its permanent
address. This packet is routed by the network to the host’s home
location because that is where the home address belongs.

Step 3:
The home agent intercepts this packet because the mobile host is away
from home. It then wraps or encapsulates the packet with a new
header and sends this bundle to the care of address . This
mechanism is called tunneling.
Routing for Mobile Hosts - Triangle Routing
Step 4:
When the encapsulated packet arrives at the care of address, the mobile
host unwraps it and retrieves the packet from the sender. The
mobile host then sends its reply packet directly to the sender .

Step 5:

As part of step 4, the sender may learn the current care of address.
Subsequent packets can be routed directly to the mobile host by
tunneling them to the care of address, bypassing the home location
entirely.
Routing for Mobile Hosts – Mobile sender

A WAN to which LANs, MANs, and wireless cells are attached.


Routing for Mobile Hosts – Mobile sender

Packet routing for mobile users.


Routing in Ad Hoc Networks
Possibilities where the routers are mobile:
1. Military vehicles on battlefield.
– No infrastructure.
2. A fleet of ships at sea.
– All moving all the time
3. Emergency works at earthquake .
– The infrastructure destroyed.
4. A gathering of people with notebook computers.
– In an area lacking 802.11.
Routing in Ad Hoc Networks
 In all above cases, and others, each node
communicates wirelessly and acts as both a host and
a router.

 Networks of nodes that just happen to be near each


other are called ad hoc networks or MANETs
(Mobile Ad hoc NETworks).

 With an ad hoc network, the topology may be changing all the


time, so the desirability and even the validity of paths can change
spontaneously without warning.
Routing in Ad Hoc Networks
 One of the most popular routing algorithm,
AODV (Ad hoc On-demand Distance Vector)
(Perkins and Royer, 1999).

1. Route Discovery
2. Route Maintenance

In AODV, routes to a destination are discovered on demand, that is,


only when a somebody wants to send a packet to that destination.
Route Discovery

(a) Range of A's broadcast. ROUTE REQUEST


(b) After B and D have received A's broadcast. ROUTE REPLY
(c) After C, F, and G have received A's broadcast.
(d) After E, H, and I have received A's broadcast.
Shaded nodes are new recipients. Arrows show possible reverse routes.
Route Discovery (2)

Format of a ROUTE REQUEST packet.


Route Discovery (3)

Format of a ROUTE REPLY packet.


Route Maintenance
Because nodes can move or be switched off, the topology can change
spontaneously.
Periodically, each node broadcasts a Hello message, Expects replay.
Purge routes that no longer work

(a) D's routing table before G goes down.


(b) The graph after G has gone down.
CONGESTION CONTROL
Too many packets present in (a part of) the network causes packet delay
and loss that degrades performance. This situation is called congestion.

If load on the network is greater than the capacity that results in


CONGESTION.

The network and transport layers share the responsibility for handling
congestion.

the most effective way to control congestion is to reduce the load that
the transport layer is placing on the network.

Unless the network is well designed, it may experience a


CONGESTION COLLAPSE, in which performance plummets as the
offered load increases beyond the capacity.
CONGESTION CONTROL

When too much traffic is offered, congestion sets in and performance


degrades sharply.
Congestion Control Algorithms
Approaches to Congestion Control
 The presence of congestion means that the load is (temporarily)
greater than the resources (in a part of the network) can handle.
 Two solutions come to mind:
increase the resources or decrease the load.

These solutions are applied on different time scales to either prevent


congestion or react to it once it has occurred.

Figure :Timescales of approaches to congestion control.


Congestion Control Algorithms
Congestion control refers to techniques and mechanisms that can either
prevent congestion, before it happens, or remove congestion, after it
has happened.

Two broad categories: open-loop congestion control (prevention) and


closed-loop congestion control (removal).
Congestion Control Algorithms
Open Loop Control: Prevention
a) Retransmission policy: and timers must to be designed to
optimize efficiency and at the same time prevent congestion

b) Window policy: Selective Repeat is better than Go-back-N

c) Acknowledgement policy: does not ACK every packet

d) Discard policy: prevent congestion and at the same time


may not harm the integrity of the transmission

e) Admission policy: Switch first check the resource


requirement of a flow before admitting it to the network
Congestion Control Algorithms
Network Provisioning: Prevention

a) Sometimes resources can be added dynamically when there


is serious congestion.

b) More often, links and routers that are regularly heavily


utilized are upgraded at the earliest opportunity.
Congestion Control Algorithms
Traffic-aware Routing: Prevention
 To make the most of the existing network capacity, routes
can be tailored to traffic patterns that change during the day
as network users wake and sleep in different time zones.

 Identify hotspots.

 The most direct way to do this is to set the link weight to be


a function of the (fixed) link bandwidth and propagation
delay plus the (variable) measured load or average queuing
delay. Least-weight paths will then favor paths that are more
lightly loaded, all else being equal.
Congestion Control Algorithms
Traffic-aware Routing: Prevention

Internet routing protocols do not generally adjust their routes depending on the
load. Instead, adjustments are made outside the routing protocol by slowly
changing its inputs. This is called traffic engineering.
Congestion Control Algorithms
Admission Control: Prevention
 The idea is simple: do not set up a new virtual circuit unless
the network can carry the added traffic without becoming
congested.
Congestion Control Algorithms
Traffic Throttling: Congestion Avoidance
 When congestion is imminent, it must tell the senders to throttle
back their transmissions and slow down.

 Throttling traffic can be used in both datagram networks and


virtual-circuit networks.

 First, routers must determine when congestion is approaching,


ideally before it has arrived.

 To do so, each router can continuously monitor the resources it is


using.

 Three possibilities are the utilization of the output links, the


buffering of queued packets inside the router, and the number of
packets that are lost due to insufficient buffering.
Congestion Control Algorithms
Traffic Throttling: Congestion Avoidance
 First approach: To maintain a good estimate of the queueing delay,
d, a sample of the instantaneous queue length, s, can be made
periodically and d updated according to

 where the constant α determines how fast the router forgets recent
history. This is called an EWMA (Exponentially Weighted
Moving Average).

 The second problem is that routers must deliver timely


feedback to the senders that are causing the congestion.
Congestion Control Algorithms
Feedback Mechanisms for congestion avoidance
a) Hop-by-Hop Back pressure: inform the previous upstream router to
reduce the rate of outgoing packets if congested

b) Choke point: a packet sent by a router to the source to inform it of


congestion, similar to ICMP’s source quench packet
Congestion Control Algorithms
Traffic Throttling: Congestion Avoidance
c) Implicit signaling: slow down its sending rate by
detecting an implicit signal concerning congestion

d) Explicit signaling: Backward signaling / Forward


signaling. ECN(Explicit Signaling Notification)
Congestion Control Algorithms
Load Shedding: Congestion Avoidance
 Load shedding is a fancy way of saying that when routers
are being inundated by packets that they cannot handle,
they just throw them away.
 The key question for a router drowning in packets is
which packets to drop.
 The preferred choice may depend on the type of
applications that use the network.
Congestion Control Algorithms
Load Shedding: Congestion Avoidance
RED (Random Early Detection) Algorithm
 By having routers drop packets early, before the situation
has become hopeless, there is time for the source to take
action before it is too late.

 To determine when to start discarding, routers maintain


a running average of their queue lengths. When the
average queue length on some link exceeds a threshold,
the link is said to be congested and a small fraction of the
packets are dropped at random.
General Principles of Congestion Control

1. Monitor the system .


– detect when and where congestion occurs.
2. Pass information to where action can be taken.
3. Adjust system operation to correct the problem.
QUALITY OF SERVICE
 Stronger network performance, on ways to provide
quality of service that is matched to application needs.

 An easy solution to provide good quality of service is to


build a network with enough capacity for whatever traffic
will be thrown at it. The name for this solution is
overprovisioning.
 Example: Telephone networks
 Problem: More expensive
QUALITY OF SERVICE

 Four issues must be addressed to ensure quality of


service:
1. What applications need from the network.
2. How to regulate the traffic that enters the network.
3. How to reserve resources at routers to guarantee
performance.
4. Whether the network can safely accept more traffic.
Quality of Service
1. Application Requirements
2. Techniques for Achieving Good Quality of Service
3. Integrated Services Two versions of QoS for
Internet
4. Differentiated Services
5. Label Switching and MPLS
QUALITY OF SERVICE
1. Application Requirements
 A stream of packets from a source to a destination is
called a flow.
 A flow might be all the packets of a connection in a
connection-oriented network, or all the packets sent from
one process to another process in a connectionless
network.
 The needs of each flow can be characterized by four
primary parameters:
 bandwidth, delay, jitter, and loss.
 Together, these determine the QoS (Quality of Service)
the flow requires.
QUALITY OF SERVICE
1. Application Requirements
A stream of packets from a source to a destination is called a flow.
QUALITY OF SERVICE
1. Application Requirements - Jitter Control

(a) High jitter. (b) Low jitter.

The variation (i.e., standard deviation) in the delay of packet arrival


times is called jitter.
QUALITY OF SERVICE
To accommodate a variety of applications, networks may support
different categories of QoS. Eg: ATM Network

They support:

1. Constant bit rate (e.g., telephony).


2. Real-time variable bit rate (e.g., compressed videoconferencing).
3. Non-real-time variable bit rate (e.g., watching a movie on demand).
4. Available bit rate (e.g., file transfer).
QUALITY OF SERVICE
2. How to regulate the traffic that enters the network.
Traffic Shaping

Traffic Profiles
a)Constant-bit-rate (CBR)
b)Variable-bit-rate (VBR)
c)Bursty –
arrives at nonuniform rates
QUALITY OF SERVICE
2.Traffic Shaping
 Traffic shaping is a technique for regulating the average rate and
burstiness of a flow of data that enters the network.
 When a flow is set up, the user and the network (i.e., the customer and
the provider) agree on a certain traffic pattern (i.e., shape) for that
flow, this agreement is called an SLA (Service Level Agreement).
 Traffic shaping reduces congestion and thus helps the network live up
to its promise.
 Monitoring a traffic flow is called traffic policing.
 Shaping and policing are not so important for peer-to-peer transfers,
but they are of great importance for real-time data, such as audio and
video connections, which have stringent quality-of-service
requirements.
QUALITY OF SERVICE
2. Traffic Shaping
 Techniques:

1. Leaky Bucket Algorithm

2. Token Bucket Algorithm


QUALITY OF SERVICE
1. Leaky Bucket Algorithm

(a) Shaping packets. (b) A leaky bucket.


QUALITY OF SERVICE
1. Leaky Bucket Algorithm

 Each host is connected to the network by an interface containing a leaky


bucket.
 To send a packet into the network, it must be possible to put more water
into the bucket.
 If a packet arrives when the bucket is full, the packet must either be
queued until enough water leaks out to hold it or be discarded.
 The former might happen at a host shaping its traffic for the network as
part of the operating system.
 The latter might happen in hardware at a provider network interface that is
policing traffic entering the network.
 This technique was proposed by Turner (1986) and is called the leaky
bucket algorithm.
QUALITY OF SERVICE
1. Leaky Bucket Algorithm

• Algorithm for variable-length packets:


1) Initialize size of bucket(B) and output rate(R)
2) If incoming data size(Z) is greater than the output rate(R), send
packet and decrement the counter by R. Repeat this step until Z
is smaller than R
3) If packet size greater than bucket capacity discard it
QUALITY OF SERVICE
2. Token Bucket Algorithm

(c) A token bucket.


(a) Shaping packets.
QUALITY OF SERVICE
2. Token Bucket Algorithm

 The network interface as a bucket that is being filled.


 The tap is running at rate R and the bucket has a capacity of B, as before.
 Now, to send a packet we must be able to take water, or tokens, as the
contents are commonly called, out of the bucket (rather than putting water
into the bucket).
 No more than a fixed number of tokens, B, can accumulate in the bucket,
and if the bucket is empty, we must wait until more tokens arrive before we
can send another packet.
 This algorithm is called the token bucket algorithm.
QUALITY OF SERVICE
3. How to reserve resources at routers to guarantee
performance.
Packet Scheduling
 Being able to regulate the shape of the offered traffic is a good start.
 To provide a performance guarantee, we must reserve sufficient resources
along the route that the packets take through the network.

 Algorithms that allocate router resources among the packets of a flow and
between competing flows are called packet scheduling algorithms.

 Three different kinds of resources can potentially be reserved for different


flows:
1. Bandwidth.
2. Buffer space.
3. CPU cycles.
QUALITY OF SERVICE
3. How to reserve resources at routers to guarantee
performance.
Packet Scheduling

i. FIFO queuing (tail drop)


ii. Priority queuing
iii. Weighted fair queuing
QUALITY OF SERVICE

• FIFO queuing
QUALITY OF SERVICE
Priority Queuing
• Packets are first assigned to priority class. Each priority class has
its own queue
• The packets in the highest-priority queue are processed first
QUALITY OF SERVICE
Weighted Fair Queuing
a) The queues are weighted based on the priority of the queues
b) The system processes packets in each queue in a round-robin
fashion with the number of packets selected from each queue based
on the weight.
QUALITY OF SERVICE
4. Whether the network can safely accept more traffic

Admission Control

 Admission control refers to the mechanism used by a router, or a


switch, to accept or reject a flow based on predefined parameters
called flow specifications.

 Before a router accepts a flow for processing, it checks the flow


specifications to see if its capacity (in terms of bandwidth, buffer
size, CPU speed, etc.) and its previous commitments to other flows
can handle the new flow.
QUALITY OF SERVICE

Two models have been designed to provide quality of


service in the Internet:

1. Integrated Services

2. Differentiated Services

Both models emphasize the use of quality of service at the


network layer (IP).
Integrated Services (IntServ)
a) Integrated Services is a flow-based QoS model designed for IP,
which means the user needs to create a flow, a kind of virtual
circuit from the source to the destination and inform all routers of
the resource requirements.
b) Signaling: Resource Reservation Protocol (RSVP)
c) Flow specification: for reservation
– Rspec (resource specification) defines the resource that the flow needs to reserve
– Tspec (traffic specification) defines the traffic characterization of the flow

d) Admission: a router decides to admit or deny the flow specification


e) Service classes: guaranteed service and controlled-load service
– Guaranteed service class: guaranteed minimum end-to-end delay
– Controlled-load service class: accept some delays, but is sensitive to an overloaded
network and to the danger of losing packets
RSVP: Resource reSerVation Protocol
a) In IntServ, the resource reservation is for a flow, a kind of
virtual circuit network out of the IP
b) RSVP is a signaling protocol to help IP create a flow and
consequently make a resource reservation
c) RSVP is a signaling system designed for multicasting
(multicat trees)
d) Receiver-based reservation
e) RSVP message: Path and Resv
f) Path message: from sender to all receivers
g) Resv message: from receivers to sender
RSVP: Resource reSerVation
Protocol
Resv Messages
a) Make a resource reservation from each receiver to sender

Reservation Merging
RSVP-The ReSerVation Protocol

(a) A network, (b) The multicast spanning tree for host 1.


(c) The multicast spanning tree for host 2.
RSVP-The ReSerVation Protocol (2)

(a) Host 3 requests a channel to host 1. (b) Host 3 then requests a


second channel, to host 2. (c) Host 5 requests a channel to host 1.
Reservation Styles
a) When there is more than one flow, the router needs to make a
reservation to accommodate all of them.
b) Wild card filter style: a single reservation for all senders
c) Fixed filter style: a distinct reservation for each flow
d) Shared explicit style: a single reservation which can be shared by
a set of flow
Soft State

• The reservation information (state) stored in every node for a


flow needs to be refreshed periodically. This is referred to as a
soft state.
• The default interval for refreshing is currently 30 s.

Problems with Integrated Services

1. Scalability
2. Service-type limitation
Differentiated Service (Diffserv)
a) Differentiated Services is a class-based QoS model designed for IP.
b) Diffserv handles the shortcomings of IntServ
c) Main differences between Diffserv and Intserv
– Main processing is moved from the core to the edge (scalability)
– The per-flow is changed to per-class flow service (service-type limitation)
d) DS field
– DSCP (DS Code Point) is a 6-bit field that define per-hop behavior (PHB)
– CU (currently unused) is 2-bit
Per-hop Behavior (PHB)
Diffserv defines three PHBs
a) DE PHB (default PHB) is the same as best-effort delivery
b) EF PHB (expedited forwarding PHB) provides the following
services:
– Low loss, low latency, ensured bandwidth
c) AF PHB (assured forwarding PHB) delivers the packet with a high
assurance as long as the class traffic does not exceed the traffic
profile of the node
Expedited Forwarding

Expedited packets experience a traffic-free network.


Assured Forwarding

A possible implementation of the data flow for assured forwarding.


Traffic Conditioner
a) Meter checks to see if the incoming flow matches the negotiated
traffic profile
b) Marker can re-mark a packet with best-effort delivery or down-
mark a packet based on the meter information; no up-mark
c) Shaper use the meter information to reshape the traffic if not
compliant with the negotiated profile.
d) Dropper, like a shaper with no buffer, discard packets if the flow
severely violates the profile
Label Switching and MPLS

Transmitting a TCP segment using IP, MPLS, and PPP.


Internetworking
• How Networks Differ
• How Networks Can Be Connected
• Concatenated Virtual Circuits
• Connectionless Internetworking
• Tunneling
• Internetwork Routing
• Fragmentation
Connecting Networks

A collection of interconnected networks.


How Networks Differ

5-43

Some of the many ways networks can differ.


How Networks Can Be Connected

(a) Two Ethernets connected by a switch.


(b) Two Ethernets connected by routers.
Concatenated Virtual Circuits

Internetworking using concatenated virtual circuits.


Connectionless Internetworking

A connectionless internet.
Tunneling

Tunneling a packet from Paris to London.


Tunneling (2)

Tunneling a car from France to England.


Internetwork Routing

(a) An internetwork. (b) A graph of the internetwork.


Fragmentation

(a) Transparent fragmentation. (b) Nontransparent fragmentation.


Fragmentation (2)

Fragmentation when the elementary data size is 1 byte.


(a) Original packet, containing 10 data bytes.
(b) Fragments after passing through a network with maximum
packet size of 8 payload bytes plus header.
(c) Fragments after passing through a size 5 gateway.
The Network Layer in the Internet

• The IP Protocol
• IP Addresses
• Internet Control Protocols
• OSPF – The Interior Gateway Routing Protocol
• BGP – The Exterior Gateway Routing Protocol
• Internet Multicasting
• Mobile IP
• IPv6
Design Principles for Internet
1. Make sure it works.
2. Keep it simple.
3. Make clear choices.
4. Exploit modularity.
5. Expect heterogeneity.
6. Avoid static options and parameters.
7. Look for a good design; it need not be perfect.
8. Be strict when sending and tolerant when receiving.
9. Think about scalability.
10. Consider performance and cost.
Collection of Subnetworks

The Internet is an interconnected collection of many networks.


The IP Protocol

The IPv4 (Internet Protocol) header.


The IP Protocol (2)

5-54

Some of the IP options.


IP Addresses

IP address formats.
IP Addresses (2)

Special IP addresses.
Subnets

A campus network consisting of LANs for various departments.


Subnets (2)

A class B network subnetted into 64 subnets.


CDR – Classless InterDomain Routing

5-59

A set of IP address assignments.


NAT – Network Address Translation

Placement and operation of a NAT box.


Internet Control Message Protocol

5-61

The principal ICMP message types.


ARP– The Address Resolution Protocol

Three interconnected /24 networks: two Ethernets and an FDDI ring.


Dynamic Host Configuration Protocol

Operation of DHCP.
OSPF – The Interior Gateway Routing
Protocol

(a) An autonomous system. (b) A graph representation of (a).


OSPF (2)

The relation between ASes, backbones, and areas in OSPF.


OSPF (3)

5-66

The five types of OSPF messeges.


BGP – The Exterior Gateway Routing
Protocol

(a) A set of BGP routers. (b) Information sent to F.


The Main IPv6 Header

The IPv6 fixed header (required).


Extension Headers

5-69

IPv6 extension headers.


Extension Headers (2)

The hop-by-hop extension header for large datagrams (jumbograms).


Extension Headers (3)

The extension header for routing.

You might also like