0% found this document useful (0 votes)
83 views

Computer Network - 278481 - Lecture 1

The document provides information about a computer networks course including learning objectives, assessment details, topics to be covered each week, references and an introduction to the network layer. It outlines the course structure, content, assessment breakdown and schedule. Key topics include network concepts, protocols, IP addressing and packet forwarding.

Uploaded by

qwery
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Computer Network - 278481 - Lecture 1

The document provides information about a computer networks course including learning objectives, assessment details, topics to be covered each week, references and an introduction to the network layer. It outlines the course structure, content, assessment breakdown and schedule. Key topics include network concepts, protocols, IP addressing and packet forwarding.

Uploaded by

qwery
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 137

TCN2141 Computer Networks

Trimester: 1 (2019 / 2020)

Coordinator /Lecturer:
Dr. Subarmaniam Kannan

1
McGraw-Hill © The McGraw-Hill Companies, Inc., 2000
1.2
1.3
Coursework Marks

Assessment Percentage

Final Exam 50%

Assignment 10%

Written Test 20%

Lab submissions 20%

1.4
Learning Objectives COURSE Domain
LEARNING Level
OUTCOMES
LO1  
Discuss basic networking concepts including
network layers, network devices and network Affective 2
topologies
LO2  
Explain the operation of the TCP/IP networks,
including network protocols and routing algorithms Cognitive 5

LO3  
Describe various networking technologies including
Local Area Networks (LANs) and Wide Area Cognitive 5
Networks (WANs)
LO4  
Construct basic network topologies for LANs and
Psychomotor 4
WANs

1.5
Midterm Exam Tentative Schedule

TCN2141 Midterm

Date:
Time: x.00 pm - x.00 pm
Lecturer Name: Dr. Subarmaniam
Subject Code: TCN2141
Subject Name: Computer Networks

1.6
WEEK DATE TOPICS Activities (Hours) REMARKS
E-Learning Lecture Tutorial Lab (Class
Replacement/
Public Holiday)

1.   1 July - 7 July Introduction to Network Layer   Lecture 1      


1.   8 July - 14 Video Lecture 2 Blended Learning
Network-Layer Protocols Tutorial 1  
July /Quiz  
1.   15 July - 21 Video Lecture 3 Blended Learning
Unicast Routing Tutorial 2  
July /Quiz  
1.   22 July - 28 Lecture 4
Multicast Routing   Tutorial 3    
July  
1.   29 July - 4 Lecture 5
Next Generation IP   Tutorial 4  
Aug  
1.   Blended
Video Lecture 6
5 Aug - 11 Introduction to Transport Layer   Lab 1 Learning
/Quiz  
Aug  
1.   Blended
Video Lecture 7
12 Aug - 18 Transport-Layer Protocols   Lab 2 Learning
/Quiz  
Aug  
1.   19 Aug - 25 Introduction to Application Lecture 8
    Lab 3  
Aug Layer  
1.   26 Aug - 1 Lecture 9 Blended Learning
Application Layer Protocols Video   Lab 4
Sept
1.   2 Sept -8 Lecture 10
Network Management:SNMP     Lab 5  
Sept  
1.   9 Sept - 15 Lecture 11
Software Defined Networking   Tutorial 5    
Sept  
1.   16 Sept - 22 Network Management:
  Lecture 12 Tutorial 6    
Sept Openflow
1.   23 Sept - 29
Peer-to-Peer Paradigm   Lecture 13 Tutorial 7    
Sept
1.   30 Sept - 6
Revision   Revision      
Oct
      35% 28 hours 14 hours 10 hours  
1.7
Tutorial Preparation
 Tutorial answers must be submitted at the
BEGINNING of each tutorial class.
 Tutorial answers must be
HANDWRITTEN.

1.8
References
 James F Kurose, (2017). Computer Networking, A top-
down approach featuring internet, 7th Edition, Prentice
Hall. ISBN-13: 978-0133594140
 Behrouz Forouzan, (2012). Data Communications and
Networking, 5th Edition. McGraw-Hill
 Tanenbaum, Andrew S., (2010). Computer Networks,
5th Ed., New Jersey, Prentice Hall. ISBN: 0-13-038488-7.
 Dougles E. Comer, (2015) Computer Networks and
Internets, 6th Edition, Prentice.

1.9
Lecture 1
Chapter 18

Introduction to
Network Layer

.
Chapter 18: Outline

18.1 NETWORK-LAYER SERVICES

18.2 PACKET SWITCHING

18.3 NETWORK-LAYER PERFORMANCE

18.4 IPv4 ADDRESSES

18.5 FORWARDING OF IP PACKETS


Chapter 18: Objective
 The first section introduces the network layer by defining the
services provided by this layer. It first discusses packetizing. It
then describes forwarding and routing and compares the two.
The section then briefly explains the other services such as flow,
error, and congestion control.

 The second section discusses packet switching, which occurs at


the network layer. The datagram approach and the virtual-circuit
approach of packet switching are described in some detail in this
section.
 The third section discusses network-layer performance. It
describes different delays that occur in network-layer
communication. It also mentions the issue of packet loss. Finally,
it discusses the issue of congestion control at the network layer.
Chapter 18: Objective (continued)
 The fourth section discusses IPv4 addressing, probably the most
important issue in the network layer. It first describes the address
space. It then briefly discusses classful addressing, which
belongs to the past but is useful in understanding classless
addressing. The section then moves to classless addressing and
explains several issues related to this topic. It then discusses
DHCP, which can be used to dynamically assign addresses in an
organization. Finally, the section discusses NAT, which can be
used to relieve the shortage of addresses to some extent.

 The fifth section discusses forwarding of network-layer packets.


It first shows how forwarding can be done based on the
destination address in a packet. It then discusses how forwarding
can be done using a label.
INTRODUCTIO
N

1.14
Interaction between layers in the OSI Model

15
OSI model and TCP/IP Model

Comput
er Routing a
Network Switching
s
Data
Communicatio
n
LAN, WAN – Updated
1.16 TCP/IP High Speed
1-4 TCP/IP PROTOCOL SUITE

The layers in the TCP/IP protocol suite do not exactly


match those in the OSI model. The original TCP/IP
protocol suite was defined as having four layers: host-to-
network, internet, transport, and application. However,
when TCP/IP is compared to OSI, we can say that the
TCP/IP protocol suite is made of five layers: physical,
data link, network, transport, and application.
Topics discussed in this section:
Physical and Data Link Layers
Network Layer
Transport Layer
Application Layer
17
SCTP: Stream Control transmission
Figure 1.16 TCP/IP and OSI model
Protocol
Combine UDP + TCP 791-804
ICMP: Internet Control Message Protocol
Error Reporting Messages
Query Messages Pg.574-580
IGMP: Internal Group Management Protocol
pg.568-682 manage group membership -
Multicasting
ARP: Address Resolution Protocol-
Broadcast “I have IP add ! MAC add ?” Pg245

18
1-5 ADDRESSING

Four levels of addresses are used in an internet


employing the TCP/IP protocols:
physical, logical, port, and specific.

Topics discussed in this section:


Physical Addresses
Logical Addresses
Port Addresses
Specific Addresses
19
Figure 1.17 Addresses in TCP/IP

MAC Address IP Address 16-bit unsigned Email add


48 bit in Hex 32 bit in integer, 0 to 65535 Host names
binary
21: File Transfer Protocol
(FTP) 22: Secure Shell
(SSH)
23: Telnet remote login
service
25: Simple Mail Transfer
Protocol (SMTP)
53: Domain Name System
(DNS) service

20
Figure 1.18 Relationship of layers and addresses in TCP/IP

21
18-1 NETWORK-LAYER SERVICES

• Before discussing the network layer in the Internet today,


let’s briefly discuss the network-layer services that, in
general, are expected from a network-layer protocol.

• Figure 18.1 shows the communication between Alice and


Bob at the network layer. This is the same scenario we used
in Chapters 3 and 9 to show the communication at the
physical and the data-link layers, respectively.

1.22
Figure 18.1: Communication at the network layer

1.23
18.1.1 Packetizing

The first duty of the network layer is definitely packetizing:


encapsulating the payload in a network-layer packet at the
source and decapsulating the payload from the network-layer
packet at the destination.

In other words, one duty of the network layer is to carry a


payload from the source to the destination without changing it
or using it.

The network layer is doing the service of a carrier such as the


postal office, which is responsible for delivery of packages
from a sender to a receiver without changing or using the
contents.

1.24
1.25
Other duties of the network layer, which are as important as
the first, are routing and forwarding, which are directly related
to each other.

Routers run routing protocols to discover neighbouring routers


and the networks attached to them. These protocols let routers
exchange information about the network topology as it
changes due to new or failed links

1.26
Intermediary devices that connect the networks are called
routers. The role of the router is to select paths for and direct
packets toward their destination. This process is known as
routing.

1.27
Classifying Routing Protocols

Dynamic Routing Protocols

Purpose Interior Gateway Protocols Exterior Gateway Protocols


(IGP) (EGP)

Distance Vector Link-State Path-Vector


Operation Routing Protocols Routing Protocols Routing Protocol

RIPv1 IGRP Classful


Behaviour
RIPv2 EIGRP OSPF IS-IS BGP Classless

RIPv1 and IGRP are legacy Link-state routing


protocols that have evolved protocols are classless
into the classless routing by nature.
protocols, RIPv2 and EIGRP.
28
Routing Process and Routing Table
172.16.1.0/24 192.168.1.0/30 192.168.2.0/30 172.16.2.0/24
.1 .1 .2 .2 .1 .1
S0/0/0 S0/0/0 S0/0/1 S0/0/1
G0/0 R1 R2 R3 G0/0

Routing update:
My 30 seconds are up. 172.16.0.0
I’m sending an update
to my RIP neighbor(s).

R2# show ip route | begin Gateway


Gateway of last resort is not set

R 172.16.0.0/16 [120/1] via 192.168.1.1, 00:00:11, Serial0/0/0


192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/30 is directly connected, Serial0/0/0
L 192.168.1.2/32 is directly connected, Serial0/0/0
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/30 is directly connected, Serial0/0/1
L 192.168.2.2/32 is directly connected, Serial0/0/1
R2#

29
Forwarding Send the packet
value out of interface 2
B Data B Data

Figure 18.2: Forwarding process

1.30
18.1.3 Other Services

Let us briefly discuss other services expected from


the network layer. (pg. 514-515)

1. Error Control- not directly ; ICMP, Checksum


2. Flow Control
3. Congestion Control- datagram dropped
4. Quality of Services- Real-time communication
5. Security- IPv4 + IPSec

1.31
18-2 PACKET SWITCHING

• From the discussion of routing and forwarding in the


previous section, we infer that a kind of switching occurs at
the network layer.

• A router, in fact, is a switch that creates a connection between


an input port and an output port (or a set of output ports), just
as an electrical switch connects the input to the output to let
electricity flow.

1.32
Types of Switching
Message
Packet switching
Circuit switching
switching is a network
involves
involves switching
setting
splitting up atechnique
information series in
of
into data
which data
intermediate
packets, is nodes,
routed in
transmitted its entirety
order
separatelyto by from
propagatethe source node
the sending
intermediate nodes
to
and the
node's destination
data to thewhen
reassembled node,
theyone
receiving node.
reach hope at aarecipient.
In such
the final time. During
situation, the
message
communicationrouting,lineevery
can intermediate
be likened toswitch in the
a dedicated
network stores the
communication whole message.
pipe.
Switching

Circuit Switching Packet Switching Message Switching

Connection Oriented Connectionless

Virtual circuit Datagram Switching


Switching
18.2.1 Datagram Approach

When the Internet started, to make it simple, the network layer


was designed to provide a connectionless service in which the
network-layer protocol treats each packet independently, with
each packet having no relationship to any other packet.

The idea was that the network layer is only responsible for
delivery of packets from the source to the destination.

In this approach, the packets in a message may or may not


travel the same path to their destination. Figure 18.3 shows the
idea..

1.34
Figure 18.3: A connectionless packet-switched network

1.35
Figure 18.4: Forwarding process in a router when used in a
connectionless network

SA DA Data SA DA Data

1.36
18.2.2 Virtual-Circuit Approach

• In a connection-oriented service (also called virtual-circuit


approach), there is a relationship between all packets
belonging to a message.
• Before all datagrams in a message can be sent, a virtual
connection should be set up to define the path for the
datagrams.
• After connection setup, the datagrams can all follow the
same path.
• In this type of service, not only must the packet contain the
source and destination addresses, it must also contain a flow
label, a virtual circuit identifier that defines the virtual path
the packet should follow.

1.37
Figure 18.5: A virtual-circuit packet-switched network

1.38
Figure 18.6: Forwarding process in a router when used in a virtual
circuit network

Incoming Outgoing
label label

1.39
Three Way Handshake

1.40
Figure 18.7: Sending request packet in a virtual-circuit network

A to B

A to B

A to B A to B

1.41
Figure 18.8: Sending acknowledgments in a virtual-circuit network

1.42
Figure 18.9: Flow of one packet in an established virtual circuit

1.43
18-3 NETWORK-LAYER PERFORMANCE

• The upper-layer protocols that use the service of the network


layer expect to receive an ideal service, but the network layer
is not perfect.

• The performance of a network can be measured in terms of


delay, throughput, and packet loss.

• Congestion control is an issue that can improve the


performance.

1.44
18.3.1 Delay

• All of us expect instantaneous response from a network, but


a packet, from its source to its destination, encounters
delays.

• The delays in a network can be divided into four types:


transmission delay, propagation delay, processing delay, and
queuing delay. (pg. 522)

• Let us first discuss each of these delay types and then show
how to calculate a packet delay from the source to the
destination..

1.45
Transmission Delay

A source host or a router cannot send a packet


instantaneously. A sender needs to put the bits in a packet
on the line one by one. If the first bit of the packet is put on
the line at time t1 and the last bit is put on the line at time
t2, transmission delay of the packet is (t2 − t1).
Definitely, the transmission delay is longer for a longer
packet and shorter if the sender can transmit faster.

In other words, the transmission delay is


Delay = (Packet length) / (Transmission rate)
tr

For example, in a Fast Ethernet LAN (see Chapter 13) with


the transmission rate of 100 million bits per second and a
packet of 10,000 bits, it takes (10,000)/(100,000,000) or
1.46
100 microseconds for all bits of the packet to be put on the
Propagation Delay

Propagation delay is the time it takes for a bit to travel from point A to point
B in the transmission media. The propagation delay for a packet-switched
network depends on the propagation delay of each network (LAN or
WAN). The propagation delay depends on the propagation speed of the
media, which is 3x108 meters/second in a vacuum and normally much less
in a wired medium; it also depends on the distance of the link. In other
words, propagation delay is

Delay = (Distance) / (Propagation speed).


pg

For example, if the distance of a cable link in a point-to-point


WAN is 2000 meters and the propagation speed of the bits in
the cable is 2 × 108 meters/second, then the propagation
delay is 10 microseconds.
1.47
Processing Delay

The processing delay is the time required for a router or a destination host to receive a

packet from its input port, remove the header, perform an error detection procedure,

and deliver the packet to the output port (in the case of a router) or deliver the packet

to the upper-layer protocol (in the case of the destination host). The processing delay

may be different for each packet, but normally is calculated as an average.

Delay = Time required to process a packet in a router or a


pr
destination host

1.48
Queuing Delay

Queuing delay can normally happen in a router. As we discuss in the next section, a router

has an input queue connected to each of its input ports to store packets waiting to be

processed; the router also has an output queue connected to each of its output ports to

store packets waiting to be transmitted. The queuing delay for a packet in a router is

measured as the time a packet waits in the input queue and output queue of a router. We

can compare the situation with a busy airport. Some planes may need to wait to get the

landing band (input delay); some planes may need to wait to get the departure band

(output delay).

Delay = The time a packet waits in input and output queues in a


1.49 qu
Total Delay

Assuming equal delays for the sender, routers, and receiver, the total delay (source-to-

destination delay) a packet encounters can be calculated if we know the number of

routers, n, in the whole path.

Total delay = (n + 1) (Delay + Delay + Delay ) + (n) (Delay )


tr pg pr qu

Note that if we have n routers, we have (n + 1) links. Therefore, we have (n + 1)

transmission delays related to n routers and the source, (n + 1) propagation delays

related to (n + 1) links, (n + 1) processing delays related to n routers and the

destination, and only n queuing delays related to n routers.


1.50
18.3.2 Throughput

• Throughput at any point in a network is defined as the


number of bits passing through the point in a second,
which is actually the transmission rate of data at that point.

• In a path from source to destination, a packet may pass


through several links (networks), each with a different
transmission rate.

• How, then, can we determine the throughput of the whole


path? To see the situation, assume that we have three links,
each with a different transmission rate, as shown in Figure
18.10.

1.51
Figure 18.10: Throughput in a path with three links in a series

We can conclude that the average data rate for this path is 100 kbps, the

minimum of the three different data rates. The figure also shows that we can

simulate the behavior of each link with pipes of different sizes; the average

throughput is determined by the bottleneck, the pipe with the smallest diameter.

In general, in a path with n links in series, we have

1.52 Throughput = minimum {TR , TR , . . . TR }.


Figure 18.11: A path through the Internet backbone

Actual situation in the Internet is that the data normally passes through two access networks and the Internet

backbone

The Internet backbone has a very high transmission rate, in the range of gigabits per second. This means that the

throughput is normally defined as the minimum trans- mission rate of the two access links that connect the source and

destination to the back- bone.

Figure 18.11 shows this situation, in which the throughput is the minimum of TR and TR .
1 2

For example, if a server connects to the Internet via a Fast Ethernet LAN with the data rate of 100 Mbps, but a user who

wants to download a file connects to the Internet via a dial-up telephone line with the data rate of 40 kbps, the throughput

is 40 kbps. The bottleneck is definitely the dial-up line.


1.53
Figure 18.12: Effect of throughput in shared links

• A router may collect the flow from several sources or distribute the flow
between several sources.
• In this case the transmission rate of the link between the two routers is
actually shared between the flows and this should be considered when
we calculate the throughput.

• For example, in Figure 18.12 the transmission rate of the main link in
the calculation of the throughput is only 200 kbps because the link is
shared between three paths.
1.54
18.3.3 Packet Loss

• Another issue that severely affects the performance of


communication is the number of packets lost during
transmission.
• When a router receives a packet while processing another
packet, the received packet needs to be stored in the input
buffer waiting for its turn.

• A router, however, has an input buffer with a limited size. A


time may come when the buffer is full and the next packet
needs to be dropped.
• The effect of packet loss on the Internet network layer is
that the packet needs to be resent, which in turn may create
overflow and cause more packet loss.

1.55
18.3.4 Congestion Control

• Congestion control is a mechanism for improving


performance.
• In Chapter 23, we will discuss congestion at the transport
layer.

• Although congestion at the network layer is not explicitly


addressed in the Internet model, the study of congestion at
this layer may help us to better understand the cause of
congestion at the transport layer and find possible remedies
to be used at the network layer.
• Congestion at the network layer is related to two issues,
throughput and delay, which we discussed in the previous
section.

1.56
Figure 18.13. Packet delay and throughput as functions of load
• When the load is below the capacity of the network, the throughput increases proportionally with

the load.

• We expect the throughput to remain constant after the load reaches the capacity, but instead the

throughput declines sharply.

• The reason is the dis- carding of packets by the routers. When the load exceeds the capacity, the

queue become full and the routers have to discard some packets.

• Discarding packets does not reduce the number of packets in the network because the sources

retransmit the packets, using time-out mechanisms, when the packets do not reach the

destinations.

• When the load is much less than the capacity of the network, the delay is at a

minimum.

• This minimum delay is composed of propagation delay and processing delay, both

of which are negligible.

• However, when the load reaches the network capacity, the delay increases sharply

because we now need to add the queuing delay to the total delay.

1.57 • Note that the delay becomes infinite when the load is greater than the capacity.
Congestion Control

Congestion control refers to techniques and mechanisms


that can either prevent congestion before it happens or
remove congestion after it has happened.
In general, we can divide congestion control mechanisms
into two broad categories:

a. Open-loop congestion control (prevention) and


b. Closed-loop congestion control (removal).

1.58
Open-loop congestion control (prevention)
Retransmission Policy

If the sender feels that a sent packet is lost or corrupted, the packet needs to be retransmitted.

Retransmission in general may increase congestion in the network. However, a good retransmission

policy can prevent congestion. The retransmission policy and the retransmission timers must be

designed to optimize efficiency and at the same time prevent congestion.

Window Policy The type of window at the sender may also affect congestion. The Selective Repeat

window is better than the Go-Back-N window for congestion control. In the Go-Back-N window,

when the timer for a packet times out, several packets may be resent, although some may have

arrived safe and sound at the receiver. This duplication may make the congestion worse. The

Selective Repeat window, on the other hand, tries to send the specific packets that have been lost or

corrupted.

Acknowledgment Policy The acknowledgment policy imposed by the receiver may also affect
1.59
Discarding Policy

A good discarding policy by the routers may prevent congestion and at the same time may not

harm the integrity of the transmission. For example, in audio transmission, if the policy is to

discard less sensitive packets when congestion is likely to happen, the quality of sound is still

preserved and congestion is prevented or alleviated.

Admission Policy An admission policy, which is a quality-of-service mechanism, can also

prevent congestion in virtual-circuit networks. Switches in a flow first check the resource

requirement of a flow before admitting it to the network. A router can deny establishing a

virtual-circuit connection if there is congestion in the network or if there is a possibility of

future congestion.
1.60
Closed-loop congestion control (removal)
Techniques

Figure 18.14: Backpressure method for alleviating congestion

The technique of backpressure refers to a congestion control mechanism in which a

congested node stops receiving data from the immediate upstream node or nodes. This may

cause the upstream node or nodes to become congested, and they, in turn, reject data from

their upstream node or nodes, and so on. Backpressure is a node- to-node congestion control

that starts with a node and propagates, in the opposite direction of data flow, to the source.

The backpressure technique can be applied only to virtual circuit networks, in which each

node knows the upstream node from which a flow of data is coming.
1.61
Figure 4.15: Choke packet

In the choke-packet method, the warning is from the router, which has
encountered congestion, directly to the source station. The
intermediate nodes through which the packet has traveled are not
warned. Use Internet Control Message Protocol (ICMP) mechanism

1.62
Implicit signaling

In implicit signaling, there is no communication between the congested node or nodes and the source.

The source guesses that there is congestion somewhere in the network from other symptoms. For

example, when a source sends several packets and there is no acknowledgment for a while, one

assumption is that the network is congested. The delay in receiving an acknowledgment is interpreted

as congestion in the network; the source should slow down.

Explicit Signaling The node that experiences congestion can explicitly send a signal to the source or

destination. The explicit-signaling method, however, is different from the choke-packet method. In

the choke-packet method, a separate packet is used for this purpose; in the explicit-signaling method,

the signal is included in the packets that carry data (Piggybacking). Explicit signaling can occur in

either the forward or the backward direction.

1.63
18-4 IPv4 ADDRESSES

• The identifier used in the IP layer of the TCP/IP


protocol suite to identify the connection of each
device to the Internet is called the Internet address
or IP address.

• An IPv4 address is a 32-bit address that uniquely


and universally defines the connection of a host or a
router to the Internet.

• The IP address is the address of the connection, not


the host or the router.
1.64
18.4.1 Address Space
• A protocol like IPv4 that defines addresses has an
address space. An address space is the total
number of addresses used by the protocol.

• If a protocol uses b bits to define an address, the


address space is 2b because each bit can have two
different values (0 or 1).

• IPv4 uses 32-bit addresses, which means that the


address space is 232 or 4,294,967,296 (more than
four billion). If there were no restrictions, more
than 4 billion devices could be connected to the
Internet.
1.65
Figure 18.16: Three different notations in IPv4 addressing

1.66
Figure 18.17: Hierarchy in addressing

1.67
18.4.2 Classful Addressing

• When the Internet started, an IPv4 address was


designed with a fixed-length prefix, but to
accommodate both small and large networks, three
fixed-length prefixes were designed instead of one
(n = 8, n = 16, and n = 24).
• The whole address space was divided into five
classes (class A, B, C, D, and E), as shown in
Figure 18.18.
• This scheme is referred to as classful addressing.
• Although classful addressing belongs to the past, it
helps us to understand classless addressing,
discussed later.
1.68
Figure 18.18: Occupation of the address space in classful addressing

1.69
18.4.3 Classless Addressing
With the growth of the Internet, it was clear that a larger
address space was needed as a long-term solution.

The larger address space, however, requires that the length of


IP addresses also be increased, which means the format of the
IP packets needs to be changed.

Although the long-range solution has already been devised and


is called IPv6, a short-term solution was also devised to use the
same address space but to change the distribution of addresses
to provide a fair share to each organization.

The short-term solution still uses IPv4 addresses, but it is


called classless addressing.

1.70
Subnetting and Supernetting

To alleviate address depletion, two strategies were proposed and, to some extent,

implemented:
In subnetting,subnetting andclass
a class A or supernetting.
B block is divided into several subnets. Each

subnet has a larger prefix length than the original network

While subnetting was devised to divide a large block into smaller ones,

supernetting was devised to combine several class C blocks into a larger block

1.71
Figure 18.19: Variable-length blocks in classless addressing

1.72
Figure 18.20: Slash notation (CIDR)

1.73
Figure 18.21: Information extraction in classless addressing

Set all
suffix bits
to 0s

Set all
suffix bits
to 1s

1.74
Example 18.1
A classless address is given as 167.199.170.82/27. We can
find the above three pieces of information as follows. The
number of addresses in the network is 232− n = 25 = 32
addresses. The first address can be found by keeping the
first 27 bits and changing the rest of the bits to 0s.

The last address can be found by keeping the first 27 bits


and changing the rest of the bits to 1s.

75
Example 18.2
We repeat Example 18.1 using the mask. The mask in
dotted-decimal notation is 256.256.256.224 The AND, OR,
and NOT operations can be applied to individual bytes using
calculators and applets at the book website.

76
Example 18.3
In classless addressing, an address cannot per se define the
block the address belongs to. For example, the address
230.8.24.56 can belong to many blocks. Some of them are
shown below with the value of the prefix associated with
that block.

77
Figure 18.22: Network address

1.78
Example 18.4
An ISP has requested a block of 1000 addresses. Since 1000
is not a power of 2, 1024 addresses are granted. The prefix
length is calculated as n = 32 − log21024 = 22. An available
block, 18.14.12.0/22, is granted to the ISP. It can be seen
that the first address in decimal is 302,910,464, which is
divisible by 1024.

79
Example 18.5
An organization is granted a block of addresses with the
beginning address 14.24.74.0/24. The organization needs to
have 3 subblocks of addresses to use in its three subnets:
one subblock of 10 addresses, one subblock of 60 addresses,
and one subblock of 120 addresses. Design the subblocks.

Solution
There are 232– 24 = 256 addresses in this block. The first
address is 14.24.74.0/24; the last address is 14.24.74.255/24.
To satisfy the third requirement, we assign addresses to
subblocks, starting with the largest and ending with the
smallest one.

80
Example 18.5 (continued)
a. The number of addresses in the largest subblock, which
requires 120 addresses, is not a power of 2. We allocate 128
addresses. The subnet mask for this subnet can be found as
n1 = 32 − log2 128 = 25. The first address in this block is
14.24.74.0/25; the last address is 14.24.74.127/25.

b. The number of addresses in the second largest subblock,


which requires 60 addresses, is not a power of 2 either. We
allocate 64 addresses. The subnet mask for this subnet can
be found as n2 = 32 − log2 64 = 26. The first address in this
block is 14.24.74.128/26; the last address is
14.24.74.191/26.

81
Example 18.5 (continued)
c. The number of addresses in the largest subblock, which
requires 120 addresses, is not a power of 2. We allocate 128
addresses. The subnet mask for this subnet can be found as
n1 = 32 − log2 128 = 25. The first address in this block is
14.24.74.0/25; the last address is 14.24.74.127/25.

If we add all addresses in the previous subblocks, the result


is 208 addresses, which means 48 addresses are left in
reserve. The first address in this range is 14.24.74.208. The
last address is 14.24.74.255. We don’t know about the prefix
length yet. Figure 18.23 shows the configuration of blocks.
We have shown the first address in each block.
82
Figure 18.23: Solution to Example 4.5

1.83
Example 18.6
Figure 18.24 shows how four small blocks of addresses are
assigned to four organizations by an ISP. The ISP combines
these four blocks into one single block and advertises the
larger block to the rest of the world. Any packet destined for
this larger block should be sent to this ISP. It is the
responsibility of the ISP to forward the packet to the
appropriate organization. This is similar to routing we can
find in a postal network. All packages coming from outside
a country are sent first to the capital and then distributed to
the corresponding destination.

84
Figure 18.24: Example of address aggregation

1.85
18.4.4 DHCP
After a block of addresses are assigned to an
organization, the network administration can manually
assign addresses to the individual hosts or routers.
However, address assignment in an organization can be
done automatically using the Dynamic Host Configuration
Protocol (DHCP).

DHCP is an application-layer program, using the client-


server paradigm, that actually helps TCP/IP at the
network layer.
-Provide Four pieces of information are normally needed:
1. the computer address,
2. The prefix,
3. the address of a router, and
4. the IP address of a name server.

1.86
Figure 18.25: DHCP message format

1.87
• The 64-byte option field has a dual purpose. It can carry
either additional information or some specific vendor
information.
• The server uses a number, called a magic cookie, in the
format of an IP address with the value of 99.130.83.99.
• When the client finishes reading the message, it looks for
this magic cookie.
• If present, the next 60 bytes are options.
• An option is composed of three fields: a 1-byte tag field, a
1-byte length field, and a variable-length value field.
• There are several tag fields that are mostly used by
• vendors.
• If the tag field is 53, the value field defines one of the 8
message types shown in Figure 18.26. We show how
these message types are used by DHCP.

1.88
Figure 18.26: Option format

1.89
Figure 18.27: Operation of DHCP

1.90
18.4.5 NAT

In most situations, only a portion of computers in a small


network need access to the Internet simultaneously.

A technology that can provide the mapping between the private


and universal addresses, and at the same time support virtual
private networks, is Network Address Translation (NAT).

The technology allows a site to use a set of private addresses


for internal communication and a set of global Internet
addresses (at least one) for communication with the rest of the
world.

1.91
Figure 18.29: NAT

• As the figure shows, the private network uses private addresses.


• The router that connects the network to the global address uses one
private address and one global address.
• The private network is invisible to the rest of the Internet; the rest of the
Internet sees only the NAT router with the address 200.24.5.8.

1.92
Figure 18.30: Address translation

• All of the outgoing packets go through the NAT router, which


replaces the source address in the packet with the global NAT
address.
• All incoming packets also pass through the NAT router, which
replaces the destination address in the packet (the NAT router
global address) with the appropriate private address.

• Figure 18.30 shows an example of address translation.


1.93
Figure 18.31: Translation

1.94
Table 18.1: Five-column translation table

• To allow a many-to-many relationship between private-network hosts


and external server programs, we need more information in the
translation table.
• For example, suppose two hosts inside a private network with
addresses 172.18.3.1 and 172.18.3.2 need to access the HTTP server
on external host 25.8.3.2.
• If the translation table has five columns, instead of two, that include the
source and destination port addresses and the transport-layer protocol,
the ambiguity is eliminated.
• Table 18.1 shows an example of such a table.
18-5 FORWARDING OF IP PACKETS

• We discussed the concept of forwarding at the


network layer earlier in this chapter.

• In this section, we extend the concept to include the


role of IP addresses in forwarding.

• As we discussed before, forwarding means to place


the packet in its route to its destination.

1.96
18.5.1 Destination Address Forwarding

• We first discuss forwarding based on the


destination address.
• This is a traditional approach, which is prevalent
today.

• In this case, forwarding requires a host or a router


to have a forwarding table.

• When a host has a packet to send or when a router


has received a packet to be forwarded, it looks at
this table to find the next hop to deliver the packet
to.
1.97
Packet Forwarding

• Two Functions:
• Path Determination
• Switching
CCNA2-98 Chapter 1
Path Determination

• The process of how the router determines which path to use


when forwarding a packet.
• The router searches its routing table for a network
address that matches the packet’s destination network.
• One of three path determinations results from this search.
• Directly connected network.
• Remote network.
• No route determined.

CCNA2-99 Chapter 1
Path Determination

• Directly Connected Network:


• R1 receives a packet destined for PC1.
• R1 looks in the routing table and determines that the
destination network is out its FastEthernet port.
• The packet is forwarded directly to the device with the
packet’s destination IP address.

CCNA2- Chapter 1
Path Determination

• Remote Network:
• R1 receives a packet from PC1 whose ultimate
destination is PC2.
• R1 looks in the routing table and determines that the path
to the destination network is via its WAN port.
• The packet is forwarded to another router. Remote
networks can only be reached by forwarding packets to
another router.

CCNA2- Chapter 1
Path Determination

• No Route Determined:
• R1 receives a packet from PC1 whose ultimate
destination is PC2.
• R1 looks in the routing table and cannot find a path to a
directly connected network or remote network.
• If the router does not have a default route, the packet is
discarded. The router sends an Internet Control Message
Protocol (ICMP) Unreachable message to the source IP
address of the packet.
CCNA2- Chapter 1
Switching Function

• Host X sends a packet to Host Y.


• A router generally relays a packet
from one data link to another, using
Remember:
two basic functions:
Two addresses are needed to
move a packeta from
• path determination function –
the source to
the destination. Routing
• a switching function –
• MAC Address
• IP AddressPacket Forwarding
• Let’s go through all of the stages
these routers use to route and
switch this packet.

CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

A111 H111 192.168.4.10 192.168.1.10

• Host X begins by encapsulating a


packet with Host Y’s IP address and
Router A’s MAC address.

How
How
does
does
HostHOST
X know
X obtain
to forward
Router
the packet
A’s Layer
to Router
2 address?
A and not
directly to Host Y?

Host X determines that the


Queries the router for the router’s
destination is NOT on the same
MAC address (more later).
network. (More Later)
The packet is forwarded to the
default gateway.
CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

A111 H111 192.168.4.10 192.168.1.10

• Router A receives the packet on


port fa0/0.

NOW what happens?


Router A uses the destination
IP address to search its routing table
for network 192.168.4.0/24.
It finds that it has a next hop
address of 192.168.2.2 and an
exit port of fa0/1.

CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

A111 H111 192.168.4.10 192.168.1.10

• Router A knows that the exit port is


an Ethernet interface.

NOW what happens?


Router A looks in a table of IP
address to MAC address for all
connected networks. If the network
isn’t there, it queries Router B for it’s
MAC address.

CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

B111
A111 A222
H111 192.168.4.10
192.168.4.10 192.168.1.10
192.168.1.10

• Router A now has all of the


information it needs to forward the
packet. It knows that the
destination MAC address is B111
and that the exit port is fa0/0.

• Router A now re-encapsulates the


frame, changing the Layer 2
addresses and switches the frame
out port fa0/1.

CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

B111 A222 192.168.4.10 192.168.1.10

• Notice that the Layer 3 addresses in


the packet DID NOT change!

• Also notice that the routing table


was used to find:
• The next hop Layer 3 address
• The next hop Layer 2 address
• The exit port to use to forward
the frame.

CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

B111 A222 192.168.4.10 192.168.1.10

• Router B receives the packet.

NOW what happens?

Router B uses the destination


IP address to search its routing table
for network 192.168.4.0/24.
It finds that it has a next hop
address of 192.168.3.2 and an
exit port of s0/1 – a serial interface.

CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

B111 A222 192.168.4.10 192.168.1.10

• Router B knows that the exit port is


a serial interface.
NOW what happens?
Since the exit interface is a serial
interface, NOT an Ethernet interface,
Router B does not need the Layer 2
address for the next hop.
Remember, serial interfaces are
like a pipe – one way in
and one way out.
CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

B111 A222 192.168.4.10 192.168.1.10

• When the interface is a point-to-


point serial connection, the routing
table process does not even look at
the next-hop IP address.

• Router B now encapsulates the IP


packet into the proper data link
frame, using the proper serial
encapsulation (HDLC, PPP, etc.).

CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

FFFF
B111 B222
A222 192.168.4.10
192.168.4.10 192.168.1.10
192.168.1.10

The destination Layer 2 address is set


to a broadcast since there is only one
end to the pipe.

The source Layer 2 address is set to


the exit port of Router B – the source
of the frame.

Finally, the frame is switched out port


s0/1 on Router B.

CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

FFFF B222 192.168.4.10 192.168.1.10

• Router C receives the frame


on the serial interface - port s0/1
NOW what happens?
Router C uses the destination
IP address to search its routing table
for network 192.168.4.0/24.
It finds that the network is a directly
connected network with an exit
interface of fa0/0.

CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

FFFF B222 192.168.4.10 192.168.1.10

• Router C realizes that this


destination IP address is on the
same network as one of its
interfaces and it can send the
packet directly to the destination
and not another router.

• Since the exit interface is on an


directly connected Ethernet
network, Router C must obtain the
destination’s MAC address.
CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

FFFF B222 192.168.4.10 192.168.1.10

• Router C looks in a table of IP


address to MAC address for all
connected networks.
• If the entry was not in the table,
Router C would need to send a
query out fa0/0 that says, “What is
the MAC address for this IP
address?”
• Host Y would send back a reply that
says, “This is the MAC address that
matches the IP Address you sent.”
CCNA2- Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source

H222
FFFF C222
B222 192.168.4.10
192.168.4.10 192.168.1.10
192.168.1.10

Router C encapsulates the Ethernet


frame and uses the destination MAC
address of Host Y.

The source Layer 2 address


becomes the MAC address of the
router’s fa0/0 port.

The frame is switched out port


fa0/0 to the
destination host – Host Y.
CCNA2- Chapter 1
Switching Function

Layer 2 Layer 2 Layer 3 Layer 3


Step
Destination Source Destination Source
Host X to
A111 H111 192.168.4.10 192.168.1.10
Router A
Router A to
B111 A222 192.168.4.10 192.168.1.10
Router B
Router B to
FFFF B222 192.168.4.10 192.168.1.10
Router C
Router C to
H222 C222 192.168.4.10 192.168.1.10
Host Y

REMEMBER THAT THE SOURCE AND DESTINATION IP


ADDRESSES REMAIN UNCHANGED!!!

CCNA2- Chapter 1
Figure 18.32: Simplified forwarding module in classless address

1.118
Figure 18.33: Configuration for Example 4.7

1.119
Example 18.7
Make a forwarding table for router R1 using the
configuration in Figure 18.33.

Solution
Table 18.2 shows the corresponding table.

Table 18.2: Forwarding table for router R1 in Figure 4.46

120
Example 18.8
Instead of Table 18.2, we can use Table 18.3, in which the
network address/mask is given in bits.
Table 18.3: Forwarding table for router R1 using prefix bits

When a packet arrives whose leftmost 26 bits in the


destination address match the bits in the first row, the packet
is sent out from interface m2. And so on.
121
Example 18.9
Show the forwarding process if a packet arrives at R1 in
Figure 18.33 with the destination address 180.70.65.140.

Solution
The router performs the following steps:
1. The first mask (/26) is applied to the destination address.
The result is 180.70.65.128, which does not match the
corresponding network address.
2. The second mask (/25) is applied to the destination
address. The result is 180.70.65.128, which matches the
corresponding network address. The next-hop address
and the interface number m0 are extracted for
forwarding the packet (see Chapter 5).
122
Longest Match: Level 1 Network Routes

• For there to be a match between the destination IP address


of a packet and a route in the routing table, a minimum
number of leftmost bits must match between the IP address
of the packet and the route in the routing table.
• The subnet mask of the route in the routing table is used
to determine the minimum number of leftmost bits that
must match.
CCNA2- Chapter 8
Longest Match: Level 1 Network Routes

• The best match or longest match is the route in the routing


table that has the greatest number of leftmost matching bits
with the destination IP address of the packet.
• Preferred Route:
• The route with the greatest number of equivalent leftmost
bits, or the longest match.

CCNA2- Chapter 8
Figure 18.34: Address aggregation

1.125
Figure 18.35: Longest mask matching

1.126
Example 18.10
As an example of hierarchical routing, let us consider Figure
18.36. A regional ISP is granted 16,384 addresses starting
from 120.14.64.0. The regional ISP has decided to divide
this block into 4 subblocks, each with 4096 addresses. Three
of these subblocks are assigned to three local ISPs, the
second subblock is reserved for future use. Note that the
mask for each block is /20 because the original block with
mask /18 is divided into 4 blocks.

The figure also shows how local and small ISPs have
assigned addresses.

127
Figure 18.35: Hierarchical routing with ISPs

1.128
18.5.2 Forwarding Based on Label

In the 1980s, an effort started to somehow change


IP to behave like a connection-oriented protocol in
which the routing is replaced by switching. As we
discussed earlier In a connection-oriented network
(virtual-circuit approach), a switch forwards a
packet based on the label attached to the packet.
Routing is normally based on searching the contents
of a table; switching can be done by accessing a
table using an index. In other words, routing
involves searching; switching involves accessing..

1.129
Example 18.11
Figure 18.37 shows a simple example of searching in a
forwarding table using the longest mask algorithm.
Although there are some more efficient algorithms today,
the principle is the same.

When the forwarding algorithm gets the destination address


of the packet, it needs to delve into the mask column. For
each entry, it needs to apply the mask to find the destination
network address. It then needs to check the network
addresses in the table until it finds the match. The router
then extracts the next-hop address and the interface number
to be delivered to the data-link layer.

130
Figure 18.37: Example 18.11: Forwarding based on destination address

1.131
Example 18.12
Figure 18.38 shows a simple example of using a label to
access a switching table. Since the labels are used as the
index to the table, finding the information in the table is
immediate.

132
Figure 18.38: Example 18.12: Forwarding based on label

1.133
Figure 18.39: MPLS header added to an IP packet

1.134
Figure 18.40: MPLS header made of a stack of labels

1.135
18.5.3 Routers as Packet Switches

• As we may have guessed by now, the packet


switches that are used in the network layer are
called routers.

• Routers can be configured to act as either a


datagram switch or a virtual-circuit switch.

• We have discussed the structure of a packet-switch


in Chapter 8. The discussion in that chapter can be
applied to any router used in the Internet.

1.136
MELAKA MMU
CISCO LOCAL NETWORKING
ACADEMY
CCNA 1 – Briefing

Date: 11 July 2019


(Tuesday)
Time: 7.00 pm
Venue: Unix Lab
(1st Floor ,FIST Block ITC)

For Further Information:


Contact: Dr.Subarmaniam – FIST
Email: [email protected]

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 137

You might also like