BSCS_CN_W22_Week10
BSCS_CN_W22_Week10
Week # 10
CS & IT Department
The University of Lahore
Powerpoint Templates 1
ACKNOWLEDGMENTS
Mostly adopted from lecture slides
by Behrouz A. Forouzan.
2
Network Layer
3
Connectionless vs. Connection Oriented
Network layer should provide weather connection oriented
or
connectionless service
Two major views are from ARPA Internet Community
and Telecommunications community
ARPA Internet Community
Routers’ job is to move packets around
(nothing else)
The network is inherently unreliable (no matter how it
is designed)
leave error and flow control to the hosts (transport
layer)
Therefore, network service should be
4
Connectionless vs. Connection Oriented
5
Implementation of Connectionless Service
6
Implementation of Connectionless Service
7
Connection Oriented Service
8
Connectionless VS.
Connection-Oriented
9
Network Layer Core Protocols
Protocols which route data from a node or hop to another hop
between two end hosts in a network are called network-
layer protocols.
12
National Internet Registry (NIR)
NIR is an organization under the umbrella of an RIR with the
task of coordinating IP addresses allocations and other
Internet resource management functions at a national level
within a country or economic unit.
NIRs operate primarily in the Asia Pacific region, under
the authority of APNIC (an RIR for that region)
13
Regional Internet Registry (RIR)
An RIR is an organization that manages the allocation and registration of
Internet number resources within a particular region of the world.
Five RIRs (worldwide)
African Network Information Centre (AfriNIC): Covers Africa region
American Registry for Internet Numbers(ARIN)
Covers North America region: United States, Canada, several parts of
Caribbean region, Antarctica
Asia-Pacific Network Information centre (APNIC)
For Asia/pacific region
Latin America and Caribbean Network Information Centre (LACNIC)
Latin America and some Caribbean Islands
Reseaux IP European Network Coordination Centre (RIPE NCC)
Europe, Russia, Middle East and Central Asia 14
Revision ! We are already familiar with , Conversions of B D & DB.
Binary:
All digital electronics use a binary method for
communication.
Binary can be expressed using only two values: 0 or 1.
1 0 1 1 0 0 1
1
16
IPv4
ADDRESSES
An IPv4 address is a 32-bit address in length that uniquely and
universally defines the connection of a device (for example, a
computer or a router) to the Internet.
17
IPv4
ADDRESSES
Dotted-decimal notation and binary notation for an IPv4 address
Errors?
18
IPv4 ADDRESSES
Hierarchy
In any communication system involving delivery, the
addressing system is hierarchal.
Postal network includes country, state, city, street, house
number, and the name of the mail recipient.
Telephone network includes country code, area code, host
exchange, and the connection.
A 32-bit IP address is divided into two parts
Prefix defines the network
Suffix defines the node (connection of a device to the
network)
19
TCP/IP
Host
A host is a device that has a network interface card
(NIC) connected to a network.
If a device has two network interfaces, it should be
considered
two separate hosts.
Each host that is attached to a TCP/IP network must have a
unique TCP/IP address.
86
90 133.120.75.8
94 129.102.12.7
129.102.0.0 133.120.0.0
131.107.0.0
129.102.16.2
131.107.3.27 20
TCP/IP
Addresses
IP Addresses divided into two
parts
Network ID or Net ID
Analogous to a street address.
Host ID
Analogous to a house or
building number.
21
Example 1
Solution
We replace each group of 8 bits with its equivalent decimal
number and add dots for separation:
a. 129.11.11.239
b. 249.155.251.15
22
Example 2
Solution
We replace each decimal number with its binary
equivalent
24
Internet Class-based addresses
Class A: large number of hosts, few networks
0nnnnnnn hhhhhhhh hhhhhhhh hhhhhhhh
7 network bits (0 and 127 reserved, so 126 networks), 24 host
bits (> 16M hosts/net)
Initial byte 1-127 (decimal)
Class B: medium number of hosts and networks
10nnnnnn nnnnnnnn hhhhhhhh hhhhhhhh
16,384 class B networks, 65,534 hosts/network
Initial byte 128-191 (decimal)
Class C: large number of small networks
110nnnnn nnnnnnnn nnnnnnnn hhhhhhhh
2,097,152 networks, 254 hosts/network
Initial byte 192-223 (decimal)
Class D: 224-239 (decimal) Multicast [RFC1112]
Class E: 240-255 (decimal) Reserved
25
Example
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 11110011 10011011 11111011 00001111
d. 14.23.120.8
e. 252.5.15.111
f. 227.12.14.87
26
Netid and Hostid
27
Class A
Address
First bit will always be a 0.
Remaining bits can be either 0s or 1s.
Range of first octet is 00000000 to 01111111
Network addresses cannot be all 0s.
127 is reserved for loopback testing
126 valid Class A network IDs
1.x.y.z to 126.x.y.z
29
Blocks in class
A
30
Class B
Address
First two bits will always be a 10.
Remaining bits can be either 0s or 1s.
Range of first octet is 10000000 to 10111111
Range of networks 128.0.y.z to 191.255.y.z
16,384 valid Class B network IDs.
31
Blocks in class B
32
Class C
Address
First three bits will always be a 110.
Remaining bits can be either 0s or 1s.
Range of first octet is 11000000 to 11011111
33
Blocks in class C
34
Class D
Address
First octet in binary is defined as 1110xxxx, replacing x’s with
whatever we wish.
Range of Class D addresses is from 224.x.y.z to 239.x.y.z.
Used for multicasting – method of sending a single packet
to multiple hosts.
35
Class E
Address
First octet is 1111xxxx, replacing x’s with whatever we wish.
Address ranges from 240.x.y.z to 255.x.y.z.
Experimental address range that is not used in actual
networks.
36
Network
Address
A network address is different from a netid.
A network address has both netid and hostid, with 0s for the
hostid
The first address is called the network address and defines the
organization network.
It defines the organization itself to the rest of the world.
The organization network is connected to the Internet via a router.
The router has two addresses. One belongs to the granted block; the
other belongs to the network that is at the other side of the router.
37
Examples: Network
Address
Given the address 23.56.7.91, find the network address.
The class is A. Only the first byte defines the netid.
We can find the network address by replacing the hostid
bytes (56.7.91) with 0s. Therefore, the network address
is 23.0.0.0.
Given the address 132.6.17.85, find the network address
The class is B. The first 2 bytes defines the netid. We
can find the network address by replacing the hostid
bytes (17.85) with 0s. Therefore, the network
address is 132.6.0.0.
38
Assigning Network IDs
1 2 3
Router Router
39
Assigning Host IDs
1 2 3
40
Address Class Summary
[[
Range of
Number Number of Hosts
Network IDs
of Networks per Network
(First Octet)
41
Addressing Guidelines
43