0% found this document useful (0 votes)
8 views43 pages

BSCS_CN_W22_Week10

This document outlines the concepts of the network layer in computer networks, focusing on connection-oriented and connectionless services, logical addressing, and IP addressing. It discusses the roles of various protocols such as IP, ARP, and ICMP, as well as the structure and classification of IPv4 addresses. Additionally, it explains the hierarchical nature of IP addressing and the allocation of IP addresses by different registries.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views43 pages

BSCS_CN_W22_Week10

This document outlines the concepts of the network layer in computer networks, focusing on connection-oriented and connectionless services, logical addressing, and IP addressing. It discusses the roles of various protocols such as IP, ARP, and ICMP, as well as the structure and classification of IPv4 addresses. Additionally, it explains the hierarchical nature of IP addressing and the allocation of IP addresses by different registries.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 43

Computer Networks

Week # 10

CS & IT Department
The University of Lahore

Powerpoint Templates 1
ACKNOWLEDGMENTS
Mostly adopted from lecture slides
by Behrouz A. Forouzan.

Week 10: Course Plan


Network Layer
 Connection oriented vs connectionless service
 Logical Addressing (IP addressing)
 Classful addressing

2
Network Layer

 Network layer is concerned with getting packets from the


source all the way to the destination
 May require many hops at intermediate routers
(multiple hops),
 rather than a single link, as in the data link layer (moving
frames from one end of wire to the other )
 Its primary function is routing
 It deals with end-end to transmission
 It involves at the source host, destination host and all routers
in the path

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

 Telecommunications community (including ISO, ATM


Forum, etc)
 network service should be (reasonably) reliable
and connection-oriented
 Their claim comes after 100 years of successful
with the
worldwide telephone system experience
 QoS, a dominant factor, is very difficult to achieve
without connections in the network, in particular, for
real time traffic such as audio and video

5
Implementation of Connectionless Service

 In this service, packets are injected into the network


directly and routed independently of each other
 No advance set up is needed
 So, packets are called datagrams and the network is
called datagram network

6
Implementation of Connectionless Service

 Routing within a datagram subnet


 Due to traffic jam, packet 4 is sent on different route

The algorithm that


manages tables and
makes the routing
decisions is called
routing algorithm

7
Connection Oriented Service

 A path from the source router all the way to


destination router must be established before any data
packets can be sent
 This connection is called Virtual Circuit (VC) and
the network is called virtual-circuit network

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.

 IP: A connectionless unreliable protocol that is part of


the TCP/IP protocol suite
 ARP (Address Resolution Protocol)
 Resolves IP addresses to MAC addresses
 ICMP (Internet Control Message Protocol)
 Diagnostics and error reporting
 IGMP (Internet Group Management
Protocol)
 Management of group multicast 10
Logical (IP) Addressing
Internet Assigned Number Authority
(IANA)
 IANA oversees global IP addressing allocation
 Responsible for global coordination
 IANA delegates Internet resources to the Regional Internet Registries (RIRs)
who, in turn, follow their regional policies to delegate resources to their
customers,
 which include Internet Service Providers and end-user organizations.

Users are assigned IP addresses from ISPs


 ISPs obtain allocation of IP addresses from
 Local Internet Registry (LIR),
 National Internet Registry (NIR) or
 Regional Internet Registry (RIR)
11
Local Internet Registry (LIR)
An organization that has been allocated a block of IP
addresses by a RIR, and that assigns most parts of this
block to its own customers.
Most LIRs are ISPs, enterprises, or academic
institutions.
 Membership in an RIR is required to become
an LIR

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 & DB.
Binary:
 All digital electronics use a binary method for
communication.
 Binary can be expressed using only two values: 0 or 1.

Converting Binary to Decimal

 Given a binary number, place the number under the chart


(right justified).
128 64 32 16 8 4 2 1

1 0 1 1 0 0 1
1

 Add the numbers together to arrive at a final decimal


amount.
 128 + 32 + 16 + 2 + 1 = 179
15
Converting Decimal to Binary
 Find the largest number that is equal to or less than the
number you are converting to binary. If our example
number is 220, the largest number that is equal to or less
than 220 is
128. Place a 1 under that space on the chart.
 Next, subtract that number from the original decimal number.
Subtracting 128 from 220 gives us 92.
 Repeat this process until we have a subtracted result of 0.
128 64 32 16 8 4 2 1
1 1 0 1 1 1 0 0

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.

 The address space of IPv4 is 232 or 4,294,967,296

To make addressing more humanly manageable, the


32 bits are broken into four 8 bit octets.

We separate the octets by using a period symbol –


135.87.252.57. This is referred to as dotted decimal
notation.

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

Change the following IP addresses from binary notation


to dotted-decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11111001 10011011 11111011 00001111

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

Change the following IP addresses from dotted-


decimal
notation to binary notation.
a. 111.56.45.78
b. 75.45.34.78

Solution
We replace each decimal number with its binary
equivalent

a. 01101111 00111000 00101101 01001110


b. 01001011 00101101 00100010 01001110
23
Finding the classes in binary and dotted-decimal notation
In classful addressing, the address space is divided into five
classes: A, B, C, D, and E

Number of blocks and block size in classful IPv4 addressing

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

 Network addresses cannot be all 0s

 Hostid: cannot be all 0s


 If host portion is all 0s, represents a network address.
 Hostid: cannot be all 1s
 If host portion is all 1s, represents broadcast address.

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

A loopback test is a test in which a signal is sent from a


communications device and returned (looped back) to it as a way
to determine whether the device is working right or as a way to
pin down a failing node in a network
Ref:
http://searchnetworking.techtarget.com/definition/loopback-test 28
Class A
Address
The address range from 0.0.0.0 through 0.255.255.255 should
not be considered part of the normal Class A range. 0.x.x.x
addresses serve no particular function in IP, but nodes attempting
to use them will be unable to communicate properly on the
Internet.

For details of special Use IPv4 addresses:


http://tools.ietf.org/html/rfc5735

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

 Range of class C networks is 192.0.0.z to 223.255.255.z.


 2,097,152 valid Class C network IDs.

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

124.x.y.z 192.121.73.z 131.107.y.z

39
Assigning Host IDs

1 2 3

124.0.0.27 124.0.0.1 192.121.73. 131.107.0.27


2
Router Router

124.0.0.28 192.121.73. 131.107.0.1 131.107.0.28


1

124.x.y.z 192.121.73.z 131.107.0.z


124.0.0.29 131.107.0.29

40
Address Class Summary
[[

Range of
Number Number of Hosts
Network IDs
of Networks per Network
(First Octet)

Class A 126 16,777,214 1 – 126

Class B 16,384 65,534 128 – 191

Class C 2,097,152 254 192 – 223

41
Addressing Guidelines

 Network ID cannot be 0 (all Bits set to 0)


 Serve no particular purpose in IP
 Network ID cannot be 127
 127 is reserved for loopback functions
 Host ID cannot be 255 (All Bits Set to
1)
 255 is a broadcast address
 Host ID cannot be 0 (All Bits Set to 0)
 0 means “this network only”
 Example: 145.20.0.0 refers to Class B
network 145.20.0.0
 Host ID Must Be unique to the Network
42
Reserved, Private addresses
Private address block:
Class A: 10.0.0.0 to 10.255.255.255
Class B: 169.254.0.0 to 169.254.255.255
and 172.16.0.0 to 172.31.255.255
Class C: 192.168.0.0 to 192.168.255.255
Reserved:
Class A: 0.0.0.0 to 0.255.255.255 & 127.0.0.0 to 127.255.255.255 (LB)
Class B: 128.0.0.0 to 128.0.255.255 & 191.255.0.0 to 191.255.255.255
Class C: 192.0.0.0 to 192.0.0.255 & 223.255.255.0 to 223.255.255.255

43

You might also like