Chapter 3
Chapter 3
State Routers do not hold state Each VC requires router table space
information information about connections per connection
Routing Each packet is routed Route chosen when VC is set up; all
independently packets follow it.
Effect of None, except for packets lost All VCs that passed through the
router during the crash failed router are terminated
failures
Quality of Difficult Easy if enough resources can be
service allocated in advance for each VC
Congestion Difficult Easy if enough resources can be
control allocated in advance for each VC
Network-Layer Performance Measures
The performance of a network can be measured in terms of
delay, throughput, and packet loss (sometimes congestion
control can also be consider to improve the performance).
vThe delays in a network can be divided into four types:
1. Transmission delay=(Packet length) / (Transmission rate)
2. Propagation delay =(Distance) / (Propagation speed)
3. Processing delay =Time required to process a packet in a
router or a destination host
4. Queuing delay=The time a packet waits in input and output
queues in a router
⁃ Total delay = (n + 1) (Delay tr + Delay pg + Delay pr) +
(n) (Delay qu), by assuming the total number of router in
the middle equals to n.
Cont’d……
Throughput is the number of bits passing through the
point in a second, which is actually the transmission rate of
data at that point.
Another issue that severely affects the performance of
communication is the number of packets lost during
transmission.
Throughput = minimum {TR1, TR2, . . . TRn}.
Introduction cont….
Router
Router cont….
Two main router functions:
⁃ Forwarding datagrams from incoming to outgoing links
⁃ Run routing algorithms/protocols (e.g., RIP, OSPF, IGRP
and others).
Input ports
An input port performs the following key functions:
⁃ It performs the physical layer function of terminating an incoming
physical link at a router.
⁃ An input port also performs link-layer functions needed to
interoperate with the link layer at the other side of the incoming link,
and
⁃ The lookup function is also performed at the input port. It is here that
the forwarding table is consulted to determine the router output port to
which an arriving packet will be forwarded via the switching fabric.
Control packets (for example, packets carrying routing protocol
information) are forwarded from an input port to the routing
processor.
Switching fabric
vIt is the heart of the router, it can be used to forward data
from incoming port to outgoing port.
vSwitching fabric can be implemented in the following
ways: Switching via memory, Switching via bus and
Switching via interconnection network (Crossbar).
Output ports
An output port stores packets received from the switching
fabric and transmits these packets on the outgoing link by
performing the necessary link-layer and physical-layer
functions.
When a link is bidirectional, an output port will typically be
paired with the input port for that link on the same line card
(a printed circuit board containing one or more input ports,
which is connected to the switching fabric).
Scheduling discipline chooses among queued datagrams for
transmission by considering the issues like:
⁃ Ordering (First Come First Served), Quality of Service
(QoS), fairness (protecting monopoly of resources).
Routing Processor
The routing processor:
⁃ Executes the routing protocols (which we’ll study in the
next classes and demonstrated in the laboratory sessions),
⁃ Maintains routing tables (by sharing routing table
information among routers) and attached link state
information (dependent on the routing algorithm used),
and
⁃ Computes the forwarding table for the router
It also performs the network management functions.
Internet Protocol (IP) and IP addressing
As with any protocol standard, IP is specified in two parts:
1.The interface with a higher layer (TCP/UDP) - specifying
the services that IP provides – IP addressing
2.The actual protocol format and mechanisms
IP basic characteristics:
⁃ Connectionless protocol - No connection is established before
sending data packets.
⁃ Best Effort (unreliable) - No overhead is used to guarantee
packet delivery.
⁃ Media Independent - Operates independently of the medium
carrying the data.
There are two IP addressing method used in networking:-
1. Internet Protocol Version 4 (IPv4) is the first 32 bits
addressing method and
2. Internet Protocol Version 6 (IPv6) 128 bits addressing.
IP Header
IP header cont…..
Version (4 bits): Indicates version number, to allow evolution of
the protocol; the value is 4.
Header Length (4 bits): Length of header in 32-bit words. The
minimum value is five, for a minimum header length of 20
octets.
Type of service: these bits were included in the IPv4 header to
allow different types of IP packets (reliability, precedence, delay,
and throughput parameters) to be distinguished from each other.
Datagram Length (16 bits): it is total length of the datagram,
including header plus data, in octets (mostly less than or equal to
1500 bytes).
Identifier, flags, fragmentation offset: these three fields have
to do with so-called IP fragmentation. The length of the
fragment (packet) is always dependent on the data link frame
size (i.e. Maximum Transmission Unit (MTU) of the current data
link protocol).
Time-to-live (TTL): field is included to ensure that datagrams
do not circulate forever in the network. This field is decremented
by one each time the datagram is processed by a router. If the
TTL field reaches 0, the datagram must be dropped.
IP header cont……
Protocol (8 bits): Indicates the next higher level protocol that
is to receive the data field at the destination; thus, this field
identifies the type of the next header in the packet after the IP
header. Example values are TCP = 6; UDP = 17 ; ICMP = 1.
Header Checksum: An error-detecting code applied to the
header only.
Source and Destination IP Address: Coded to allow a
variable allocation of bits to specify the network and the end
system attached to the specified network.
The options parameter: it allows for future extensibility and
for inclusion of parameters that are usually not invoked. The
currently defined options are as follows:
⁃ Security, source routing, route recording, stream
identification and time-stamping.
Padding (variable): Used to ensure that the datagram header
is a multiple of 32 bits in length.
Data (variable): This field contains the data to be
transmitted in the datagram.
IPv4 Addressing
IP address: it is a 32-bit identifier for host and router interfaces
(both physical and logical interfaces have an ip address).
Interface is a boundary between the host and the physical link
in computer networking.
An IP address is technically associated with an interface, rather
than with the host or router containing that interface.
These addresses are typically written in so-called binary and
dotted-decimal notation, in which each byte of the address is
written in its decimal form and is separated by a period (dot)
from other bytes in the address. Dotted-decimal
notation and binary
Example:
notation for an IPv4
address
These addresses cannot be chosen in a willy-nilly manner, however. A
portion of an interface’s IP address will be determined by the subnet
to which it is connected.
ÿ IPv4 uses 32-bit addresses, which means that the address space is 232
or 4,294,967,296 (more than 4 billion). This means that, theoretically,
if there were no restrictions, more than 4 billion devices could be
connected to the Internet. .
IPv4 Addressing cont…
Cont’d…
Rules for IPV4 Representation
vA mixture of binary notation and dotted-decimal notation is
not allowed.
vThere can be no more than four numbers.
vEach number needs to be less than or equal to 255.
vThere must be no leading zero .
Solution
We replace each group of 8 bits with its equivalent decimal
number and add dots for separation.
Solution
We replace each decimal number with its binary equivalent.
IPv4 Addressing cont’d….
Class full addressing
Network Classes: the address is coded to allow a variable allocation of
bits to specify network and host. This encoding provides flexibility in
assigning addresses to hosts and allows a mix of network sizes on an
internet.
In class full addressing, the address space is divided into five classes:
A, B, C, D, and E. Each class occupies some part of the address space.
The three principal network classes are best suited to the following
conditions:
⁃ Class A: Few networks, each with many hosts
⁃ Class B: Medium number of networks, each with a medium number
of hosts
⁃ Class C: Many networks, each with a few hosts
Solution
a. The first bit is 0. This is a class A address.
b.The first 2 bits are 1; the third bit is 0. This is a class C address.
c. The first byte is 14; the class is A.
d.The first byte is 252; the class is E.
Classes and Blocks
One problem with classful addressing is that each class is
divided into a fixed number of blocks with each block having
a fixed size .
Subnet 0 128
First host 1 129
Last host 126 254
Broadcast 127 255
Subnet cont…..
Example 2. cont……
A host has the IP address 194.20.5.103/27.
What are the network address, broadcast address, and valid host
addresses for the IP subnet of which the host is a member of?
what is the subnet mask in dotted-decimal notation?
Question 3: What is the first valid host on the subnetwork that
the node 192.168.196.93/30 belongs to?
Subnet
First host
Last host
Broadcast
Subnet cont….
Example 2: 168.22.0.0/20 (255.255.240.0) class B network
Example 3: 42.0.0.0/10 (255.192.0.0) class A network
Example 4: 172.26.0.0/23 (255.255.254.0) in a classless Ip-
address with /19 prefix.
Example 5: 192.168.64.0/27 (255.255.255.224) in a
classless IP-address with /22 prefix.
Example 6: A host has the IP address 198.22.45.183/26.
What are the network address, broadcast address, and valid
host addresses for the IP subnet of which the host is a
member of?
what is the subnet mask in dotted-decimal notation?
Classless Addressing
Restriction
• To simplify the handling of addresses, the Internet
authorities impose three restrictions on classless address
blocks:
1. The addresses in a block must be contiguous, one after another.
2. The number of addresses in a block must be a power of 2 (1, 2, 4,
8 .... ).
3. The first address must be evenly divisible by the number of
addresses.
First Address
⁕ The first address in the block can be found by setting the 32
- n rightmost bits in the binary notation of the address to 0s.
Example 5
A block of addresses is granted to a small organization.
We know that one of the addresses is 205.16.37.39/28.
What is the first address in the block?
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010
or
205.16.37.32.
Last Address
The last address in the block can be found by setting the 32 -
n rightmost bits in the binary notation of the address to 1s.
Example 6
Find the last address for the block in Example 5.
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 0010
or
205.16.37.47
Number of Addresses
The number of addresses in the block is the difference
between the last and first address.
It can easily be found using the formula 232-n.
Example 7
Find the number of addresses in Example 5.
Solution
The value of n is 28, which means that number of
addresses is 2 32−28 or 16
Method II
Router R
Server 0
PC0
Laptop 0
Server 2
Laptop 1
Laptop 2
Routing and Routing Tables
• Routing is a process where the data has to be transmitted from source to
destination by taking the shortest path to transmit data from the source
to the destination efficiently.
• A routing table is a set of rules, often viewed in table format, that
determines where data packets traveling over a network will be directed.
The basic components of each entry in the routing table are:
⁃ Destination address: this refers to the IP address of the destination
network.
⁃ Subnet mask/Netmask: this refers to the class or range of the destination
address. It’s used to map the destination address to the right network.
⁃ Gateway/Next Hop: this refers to the next IP address to which the packet
is forwarded.
⁃ Interface: this refers to the outgoing interface that connects to the
destination.
⁃ Metric: this assigns a value to each route to ensure that optimal routes are
chosen for sending packets. In some instances, the metric is the number of
hops or number of routers to be crossed to get to the destination network.
If multiple routes exist, the route with the lowest metric is usually chosen.
Routing Protocols and their classifications
§ Different routing protocols use different algorithms and
approaches to gather and disseminate routing information
about their area.
§ Routing protocols are classified into the following
categories:
Updates frequently
Updates are event triggered
Each router is "aware" of
Each router is "aware" of all
only its immediate neighbors other routers in the "area"
Slow convergence Fast convergence
Prone to routing loops Less subject to routing loops
Easy to configure More difficult to configure
Fewer router resources More router resource
required intensive
Updates require more Updates require less
bandwidth bandwidth
Does not "understand" the Has detailed knowledge of
topology of the network distant networks and routers
Routing Algorithm
It is the part of the network layer software responsible for
deciding which output line an incoming packet should be
transmitted on.
If the network uses datagrams internally, this decision must be
made a new path for every arriving data packet.
If the network uses virtual circuits internally, routing decisions
are made only when a new virtual circuit (sometimes called
session) is being set up.
A host is attached directly to one router, the default router for the
host.
The purpose of a routing algorithm is then simple: given a set of
routers, with links connecting the routers, a routing algorithm
finds a “good” path from source router to destination router.
Typically, a good path is one that has the least cost/fastest/least
congested.
Routing Algorithm cont….
The design of routing algorithm may have the following
properties into consideration: correctness, simplicity,
robustness, stability, fairness, and efficiency.
Routing algorithms can be grouped into two major classes:
non-adaptive and adaptive.
ØNon-adaptive (static) algorithms
ØAdaptive (dynamic) algorithms
⁃ These dynamic routing algorithms differ in where they get
their information, when they change the routes, and what
metric is used for optimization.
Others classify routing algorithms into: global or
decentralized, link-state or distance-vector and load sensitive
or load-insensitive.
Routing Algorithm cont….
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.
To see this, call the part of the route from I to J r1 and the rest of the
route r2.
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 and is
illustrated in the next slide.
Shortest Path Algorithm
The idea is to build a graph of the network, with each node of
the graph representing a router and each edge of the graph
representing a communication line, or link.
To choose a route between a given pair of routers, the algorithm
just finds the shortest path between them on the graph.
The concept of a shortest path deserves some explanation.
⁃ One way of measuring path length is the number of hops.
⁃ Another metric is the geographic distance in kilometers.
Flooding
In this algorithm every incoming packet is sent out on every
outgoing line except the one it arrived on.
Flooding obviously generates vast numbers of duplicate
packets, in fact, an infinite number unless some measures are
taken to damp the process.
⁃ One such measure is to have a hop counter contained in the
header of each packet that is decremented at each hop, with
the packet being discarded when the counter reaches zero.
⁃ Another technique for damming the flood is to have routers
keep track (sequence number)of which packets have been
flooded, to avoid sending them out a second time.
It is effective for broadcasting information, tremendously robust
and requires little in the way of setup.
Flooding cont….
Hierarchical Routing
As networks grow in size, the router routing tables grow
proportionally. It affects router memory, CPU time and
bandwidth to send status reports to others.
At a certain point, it is no longer feasible for every router to
have an entry for every other router, so the routing will have to
be done hierarchically.
When hierarchical routing is used, the routers are divided
regions.
Each router knows all the details about how to route packets to
destinations within its own region but knows nothing about
other regions.
When a single network becomes very large, an interesting
question is ‘‘how many levels should the hierarchy have?’’
Distance Vector Routing
A distance vector routing algorithm operates by having each
router maintain a table (i.e., a vector) giving the best known
distance to each destination and which link to use to get there.
These tables are updated by exchanging information with the
neighbors.
In distance vector routing, each router maintains a routing table
indexed by, and containing one entry for each router in the
network.
This entry has two parts:
⁃ The preferred outgoing line to use for that destination and
⁃ An estimate of the distance to that destination.
The commonly used distance vector routing protocols are: RIP
(Routing Information Protocol), BGP (Border Gateway
Protocol), IGRP (Interior Gateway Routing Protocol) and the
original ARPAnet.
Distance Vector Routing cont….
Link State Routing
The idea behind link state routing can be stated as five parts.
Each router must do the following things to make it work:
1. Discover its neighbors and learn their network addresses.
2. Set the distance or cost metric to each of its neighbors.
3. Construct a packet telling all it has just learned.
4. Send this packet to and receive packets from all other routers.
5. Compute the shortest path to every other router.
In effect, the complete topology is distributed to every router.
Link state cont….
Link State Routing cont…..
Learning about the Neighbors
When a router is booted, its first task is to learn who its
neighbors are.
It accomplishes this goal by sending a special HELLO packet
on each point-to-point line.
The router on the other end is expected to send back a reply
giving its name.
Link State Routing cont…..
Setting Link Costs
The link state routing algorithm requires each link to 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 and distance gap between two routers of the link.
The most direct way to determine this delay is to send over the
line a special ECHO packet that the other side is required to send
back immediately.
By measuring the round-trip time and dividing it by two, the
sending router can get a reasonable estimate of the delay.
Link State Routing cont…..
Building Link State Packets
Building the link state packets is easy.
The hard part is determining when to build them.
One possibility is to build them periodically, that is, at regular
intervals.
Another possibility is to build them when some significant event
occurs, such as a line or neighbor going down or coming back up
again or changing its properties appreciably.
Link State Routing cont…..
Distributing the Link State Packets
The trickiest part of the algorithm is distributing the link state
packets.
All of the routers must get all of the link state packets quickly
and reliably.
If different routers are using different versions of the topology,
the routes they compute can have inconsistencies such as loops,
unreachable machines, and other problems.
The fundamental idea is to use flooding to distribute the link
state packets to all routers.
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 different directions may even have different costs.
The shortest-path computations may then find different paths
from router A to B than from router B to A.
Link State Routing cont…..
Compared to distance vector routing, link state routing requires
more memory and computation.
For a network with n routers, each of which has k neighbors, the
memory required to store the input data is proportional to kn,
which is at least as large as a routing table listing all the
destinations.
Also, the computation time grows faster than kn, even with the
most efficient data structures, an issue in large networks.
Nevertheless, in many practical situations, link state routing
works well because it does not suffer from slow convergence
problems.
The two commonly used link state routing protocols IS-IS
(Intermediate System-Intermediate System) and OSPF (Open
Shortest Path First).
Asynchronous Transfer Mode (ATM)
ATM is a switching and multiplexing technology that employs
small, fixed-length packets called cells.
A fixed-size packet makes switching and multiplexing efficient
and a small cell size was chosen to support delay-intolerant
interactive voice service.
ATM is a connection-oriented packet-switching technology that
was designed to provide the performance of a circuit-switching
network and the flexibility and efficiency of a packet-switching
network.
ATM was intended to provide a unified networking standard for
both circuit-switched and packet-switched traffic, and to support
data, voice, and video with appropriate QoS mechanisms.
ATM is used by ISP to implement wide area networks.
Many DSL implementations use ATM over the basic DSL
hardware for multiplexing and switching, and ATM is used as a
backbone network technology in numerous IP networks and
portions of the Internet.
ATM cont…..
ATM Logical Connections
Virtual channel connections (VCCs) is analogous to a virtual
circuit; it is the basic unit of switching in an ATM network.
A VCC is set up between two end users through the network, and
a variable-rate, full-duplex flow of fixed-size cells is exchanged
over the connection.
VCCs are also used for user–network exchange (control
signaling) and network–network exchange (network management
and routing).
A virtual path connection (VPC) is a bundle of VCCs that have
the same endpoints. Thus, all of the cells flowing over all of the
VCCs in a single VPC are switched together.
ATM cont….
Advantages of using a virtual paths:
Simplified network architecture
Increased network performance and reliability
Reduced processing and short connection setup time
Enhanced network services
Virtual Path/Virtual Channel Characteristics ITU-T
recommend the following as characteristics:
Quality of service (QoS)
Switched and semipermanent virtual channel connections
Cell sequence integrity
Traffic parameter negotiation and usage monitoring
Virtual channel identifier restriction within a VPC (unique for
Virtual Path)
ATM Cell Format
ATM Cell Format cont…
The Generic Flow Control (GFC): it can be used for control of cell
flow only at the local user–network interface. The field could be used
to assist the customer in controlling the flow of traffic for different
qualities of service. In any case, the GFC mechanism is used to
alleviate short-term overload conditions in the network.
The virtual path identifier (VPI) constitutes a routing field for the
network. In the network cell allows support for an expanded number of
VPCs internal to the network, to include those supporting subscribers
and those required for network management. The virtual channel
identifier (VCI) is used for routing to and from the end user.
The Payload Type (PT) field indicates the type of information in the
information field (the detail codes found in the next slide).
The Cell Loss Priority (CLP) bit is used to provide guidance to the
network in the event of congestion. A value of 0 indicates a cell of
relatively higher priority, which should not be discarded unless no
other alternative is available. A value of 1 indicates that this cell is
subject to discard within the network.
The Header Error Control (HEC) field is an 8-bit error code that can
be used to correct single-bit errors in the header and to detect double-
bit errors.
ATM Cell Format cont…..
Next Chapter IV
Transport Layer