FoN Ch4
FoN Ch4
Fundamentals of Networking
2 / 66
The Network Layer Internetworking
Internetworking
Internetworking refers to the logical gluing of heterogeneous physical
networks together to look like a single network to the upper transport and
application layers
Cont..
The network layer is responsible for host-to-host delivery and for routing
the packets through the routers or switches
4 / 66
The Network Layer Internetworking
Cont..
Network layer at source
Receives data from the transport layer
Adds the universal addresses of A and D
Makes sure the packet is of correct size for passage through the next link,
fragment it if necessary
Network layer at router or switch
Responsible for routing the packet using a routing table
The packet may go through another fragmentation if need be
Network layer at destination
Address verification; error detection; reassembling the fragments
Delivering to the transport layer
5 / 66
The Network Layer Addressing
Addressing
6 / 66
The Network Layer Addressing
Cont...
7 / 66
The Network Layer Routing, Routing Protocols and Multicasting
Making a decision and choosing one route whenever there are multiple
routes
Based on some criteria; how do you choose a route when you drive? may
be the condition of your car and the road, the shortest one, the one that is
not congested, the one with less traffic lights, avoid forbidden paths
(American military packets may not pass through Russia), ...
It is the job of the network layer routing protocol; a combination of rules
and procedures that lets routers in the internet inform one another of
changes (to share whatever they know about the internet or their
neighborhood); e.g. a failure of a network can be communicated
At the heart of such protocol is the routing algorithm that determines the
path for a packet
8 / 66
The Network Layer Routing, Routing Protocols and Multicasting
Cont...
Given big internetworks such as the Internet, the number of entries in the
routing table becomes large and table look ups become inefficient;
methods for reducing its size required
9 / 66
The Network Layer Routing, Routing Protocols and Multicasting
Cont...
Next-hop routing: the routing table holds only the information that leads
to the next hop
10 / 66
The Network Layer Routing, Routing Protocols and Multicasting
Cont...
Two kinds of routing algorithms (routing tables): nonadaptive (static)
and adaptive (dynamic)
Nonadaptive (Static)
Routing decisions are not based on measurements or estimates of the current
topology or traffic
The choice of a root is computed in advance, off-line, and downloaded to the
routers when the network is booted or
An administrator enters the route for each destination into the table; not
automatically updated when there is a change; may be used in a small internet,
but not for big internet like the Internet
Adaptive (Dynamic)
Routing decisions are made periodically (every sec) to reflect changes in the
topology, traffic, a shutdown of a router, a break in the link, a better route has
been created, ...
11 / 66
The Network Layer Routing, Routing Protocols and Multicasting
Cont...
12 / 66
The Network Layer Routing, Routing Protocols and Multicasting
Cont...
R1, R2, R3, and R4 use both interior and exterior routing protocols
The rest use only interior routing protocols
Solid lines - communication between routers
Boken lines - communication between the routers that use an exterior
routing protocol
13 / 66
The Network Layer Routing Protocols: Unicast Routing Protocols
14 / 66
The Network Layer Routing Protocols: Unicast Routing Protocols
15 / 66
The Network Layer Routing Protocols: Unicast Routing Protocols
17 / 66
The Network Layer Routing Protocols: Unicast Routing Protocols
18 / 66
The Network Layer Routing Protocols: Unicast Routing Protocols
Routing Protocols
Hierarchical Routing
To limit the size of the routing table and the time for table look-up
The routers are divided into regions
Each router knows all the details in its region; but knows nothing about the
internal structure of the other regions
19 / 66
The Network Layer Routing Protocols: Unicast Routing Protocols
Routing Protocols
Multicast Routing
Multicasting: delivery of data from one host to many destinations; as a
result of multimedia applications
A one-to-many relationship
A multicast router may forward a received packet through several of its
ports (or discard it if it is not in the multicast path)
20 / 66
The Network Layer Routing Protocols: Unicast Routing Protocols
Routing Protocols
Multicast Routing
It requires group membership management - to create and destroy groups,
to allow processes (loyal members) to join and leave groups
One such protocol is IGMP (Internet Group Management Protocol)
has various versions - we don’t deal with the details
Not a concern of the routing algorithm; routers should only know which of
their hosts belong to which groups
A multicast router connected to a network has a list of multicast addresses
of the groups for which the router distributes packets to groups with at
least one loyal member in that network
For each group, there is one router which has the duty of distributing the
multicast packets destined for that group
Multicasting has many applications: access to distributed systems ,
information dissemination , distance learning, multimedia
communications
21 / 66
The Network Layer Routing Protocols: Unicast Routing Protocols
Routing Protocols
22 / 66
The Network Layer Routing Protocols: Unicast Routing Protocols
Routing Protocols
23 / 66
The Network Layer Packetizing and Fragmenting
24 / 66
The Network Layer The Network Layer in the Internet
There are 5 network layer protocols in the TCP/IP protocol suite (IP,
ARP, RARP (DHCP), ICMP, and IGMP)
The main protocol is IP, the glue that holds the whole Internet together
and responsible for host-to-host delivery
It needs the services of other protocols
ARP (Address Resolution Protocol) - maps an IP address to a MAC
address (of the next hop)
RARP (Reverse ARP) - maps a MAC address to an IP address; usually
used in some situations such as when a diskless host is booted; it gets the
binary image of its operating system from a remote file server but does not
know its IP address; obsolete, replaced by DHCP- Dynamic Host
Configuration Protocol
ICMP (Internet Control Message Protocol) - to handle unusual situations
such as the occurrence of an error
IGMP (Internet Group Management Protocol) - for multicasting since IP
is designed for unicast delivery; you can read about it
25 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Every host and router on the Internet has an IP address (its network
number and host number)
Unique and universal for global communication (no 2 hosts have the
same address, but a host can have 2 IP addresses)
32-bit in IPv4 written as 4 decimal numbers (128 in IPv6)
With 32-bits there are 232 (4,294,267,296) hosts; assumed too many
initially; now not sufficient due to a number of reasons (mainly wastage)
Classful Addressing
Address space is divided into 5 classes: A, B, C, D, and E
The first few bits indicate the class of an address
26 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
addresses in classes A, B, and C are for unicast communication; a host
needs to have at least one unicast address to be able to send and receive
addresses in class D are for multicast communication (only as a
destination); if a host belongs to a group or groups, it can have one or
more multicast addresses
addresses in class E are reserved; the idea was to use them for special
purposes
Netid and Hostid
Addresses in classes A, B, and C are divided into netid (network) and
hostid (host) of varying length from class to class
27 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
28 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Classes and Blocks
Class A
E.g. organization X granted a block with netid 73
The first address (73.0.0.0) is used to identify the organization (called the
network address)
The last address is reserved for a special purpose
Total number of organizations that can be assigned class A addresses is
126 (128-2) because all 0’s and 1’s are reserved
The number of addresses in each block (16, 777, 214 = 224 − 2)are larger
than the needs of almost all organizations
Millions of class A addresses are wasted
29 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Classes and Blocks
Class B
Divided into 16,384 (214 ) blocks, each block having a different netid (the
first two bits of byte 1 are always 10)
block 1: from 128.0.0.0 to 128.0.255.255 - netid 128.0
block 2: from 128.1.0.0 to 128.1.255.255 - netid 128.1
.
.
last block: from 191.255.0.0 to 191.255.255.255 - netid 191.255
16 blocks are reserved for private addresses
Total number of organizations that can be assigned class B addresses is
16,368 (16,384-16)
Class B addresses were designed for midsize organizations (up to 65,534
= 216 -2 hosts)
The number of addresses in each block is larger than the needs of most
midsize organizations
Many class B addresses are wasted
30 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
31 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
32 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
33 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
34 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Network Address
An address that defines the network itself
It cannot be assigned to a host
Properties
all hostid bytes are 0s; it is different from a netid, a network address has
both netid and hostid, with 0s for the hostid
It defines the network to the rest of the Internet; routing to a host is based
on the network address
In classful addressing, the network address is the one that is assigned to
the organization
35 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Network Address
36 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Reserved IP Address
Few addresses are used for specific purposes.
37 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Default Mask
Although the length of the network ID and host ID (in bits) is
predetermined in classful addressing, we can also use a mask (also called
the default mask), a 32-bit number made of contiguous 1s followed by
contiguous 0s. The masks for classes A, B, and C are shown below
The mask can help us to find the network ID and the host ID. For
example, the mask for a class A address has eight 1s, which means the
first 8 bits of any address in class A define the network ID; the next 24
bits define the host ID.
38 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Address Depletion
The weakness in classful addressing scheme combined with the fast
growth of the Internet led to the near depletion of the available addresses.
With the increasing number of device on the internet, We have run out of
class A and B addresses, and a class C block is too small for most
medium size organizations.
One solution that has alleviated the problem is the idea of classless
addressing.
39 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Subnetting
process of segmenting a network into multiple smaller network spaces called
sub-networks or Subnets.
A Subnetting, or subnetworking, is the process of splitting a single large
network into two or more parts. This means that a huge network can be
subdivided into smaller, more localized networks.
Traditional Internet uses two-level address hierarchy: network portion and host
portion.
Subnetting provides another, third, level of hierarchy. (Network Portion,
Subnet Portion, Host Portion)
Communication between subnet
A router is necessary for devices on different networks and subnets to
communicate.
Each router interface must have an IPv4 host address that belongs to the
network or subnet that the router interface is connected to.
Devices on a network and subnet use the router interface attached to their
LAN as their default gateway. 40 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Subnetting
Benefits of Subnetting
Reduced network traffic:- We all appreciate less traffic of any kind.
Optimized network performance:- This is a result of reduced network
traffic.
Simplified management:- It’s easier to identify and isolate network
problems in a group of smaller connected networks than within one
gigantic network.
Facilitated spanning of large geographical distances:- Because WAN
links are considerably slower and more expensive than LAN links, a single
large network that spans long distances can create problems in every area.
Connecting multiple smaller networks makes the system more efficient.
41 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Subnetting
IP Subnetting Fundamental
Planning requires decisions on each subnet in terms of size, the number of
hosts per subnet, and host address is will be assigned. ???????
42 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Basic Subnetting
43 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Subnets in Use
44 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Subnetting Formulas
45 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
46 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
47 / 66
The Network Layer IP v4 and Subnetting
48 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
49 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Sub netting Based on Host Requirements
Calculate number of subnets
Formula 2n (where n is the number of bits borrowed)
1 Subnet needed for each department
50 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
51 / 66
The Network Layer IP v4 and Subnetting
52 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Practice
Network is 192.168.55.0
You want to divide the network into subnets.
You will have approximately 25 nodes per subnet.
What subnet mask should you use?
What is the address of the last node on the last subnet?
What address would this node use to send to all devices on its subnet?
53 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
One More
Network is 172.16.0.0
You want to divide the network into subnets.
You will allow 600 nodes per subnet.
What subnet mask should you use?
What is the address of the first node on the first subnet?
What address would this node use to send to all devices on its subnet?
54 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Classless Addressing
There is too much wastage of IP addresses in classful addressing creating
shortage of IP addresses classless addressing was announced in 1996
The idea of variable-length blocks that belong to no class was introduced
to allocate the remaining IP addresses
Blocks of 2 addresses, 4 addresses, 64 addresses, ... can be assigned to
an organization based on size
The number of addresses in a block must be a power of 2
The whole address space (232 addresses) is divided into blocks of
different sizes
The beginning address must be evenly divisible by the number of
addresses; if a site needs, say, 2000 addresses it is given a block of 2048
addresses on a 2048 address boundary
An organization is given the beginning address of the block and a mask
(in slash notation) 55 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
Variable Length Subnet Masks (VLSM)
Classeless addressing alleviates the depletion of addresses, but we now need a
new method of forwarding packets, called CIDR (Classless InterDomain
Routing)
VLSM allows a network space to be divided in unequal parts.
Subnet mask will vary depending on how many bits have been borrowed
for a particular subnet.
Network is first subnetted, and then the subnets are subnetted again.
Process repeated as necessary to create subnets of various sizes.
If all subnet masks for an IP network must be the same size, use
fixed-length subnet masking (FLSM)
If all subnet masks can be different sizes, use variable-length subnet
masking (VLSM)
In modern networks, use VLSM to conserve IP addresses.
56 / 66
The Network Layer IP v4 and Subnetting
IP Addresses
57 / 66
The Network Layer Address Resolution
Address Resolution
58 / 66
The Network Layer Address Resolution
Address Resolution
Static Mapping
Create a table that associates an IP address with a MAC address, stored
in each machine on a network
network performance is degraded to update the table periodically (a
machine could change its network card; in some LANs such as LocalTalk
of apple, the MAC address changes every time the computer is turned
on; a mobile computer can move from one physical network to another)
Dynamic Mapping
Each time a machine knows one of the two addresses, it can use a
protocol to find the other one
Two protocols: ARP (maps an IP address to a MAC address) and RARP
(maps a MAC address to an IP address; obsolete, replaced by DHCP-
Dynamic Host Configuration Protocol)
59 / 66
The Network Layer Address Resolution
Address Resolution
ARP (Address Resolution Protocol)
A host or a router looking for a MAC address broadcasts an ARP query
packet - it includes the MAC (physical) and IP addresses of the sender
and the IP address of the receiver
Only the intended recipient sends back an ARP response packet (it
contains the recipient’s IP and physical addresses); it is unicast
60 / 66
The Network Layer DHCP (Dynamic Host Configuration Protocol)
62 / 66
The Network Layer DHCP (Dynamic Host Configuration Protocol)
63 / 66
The Network Layer ICMP (Internet Control Message Protocol)
64 / 66
The Network Layer ICMP (Internet Control Message Protocol)
Query Messages
To diagnose some network problems
66 / 66