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

Unit-2 Network Layer - IP Addressing

Here are the key steps to find the NetID and DBA from a given IP address: 1. Identify the class of the IP address based on the first octet. For example, 201.15.19.62 is a Class C address. 2. Use the class-based subnet mask. For a Class C address, the mask is 255.255.255.0. 3. Perform a logical AND operation between the IP address and the subnet mask to obtain the NetID. For 201.15.19.62 with a Class C mask, the NetID is 201.15.19.0. 4. The DBA (Directed Broadcast Address) is obtained by setting all

Uploaded by

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

Unit-2 Network Layer - IP Addressing

Here are the key steps to find the NetID and DBA from a given IP address: 1. Identify the class of the IP address based on the first octet. For example, 201.15.19.62 is a Class C address. 2. Use the class-based subnet mask. For a Class C address, the mask is 255.255.255.0. 3. Perform a logical AND operation between the IP address and the subnet mask to obtain the NetID. For 201.15.19.62 with a Class C mask, the NetID is 201.15.19.0. 4. The DBA (Directed Broadcast Address) is obtained by setting all

Uploaded by

Prachi Aggarwal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Unit-2

Network Layer
▪ IP Addressing
▪ Subnetting
▪ Super-netting

13.1
ADDRESSING

Addresses in TCP/IP

Four levels of addresses are used in an internet


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

2.2
Relationship of Layers and Addresses in TCP/IP

2.3
Physical Addresses
• Also known as Link Address
• Address of a node as defined by LAN or WAN
• Included in the frame used by DLL
• Lowest level address
• Size and format of P.A. Depends on the Network
• Ethernet uses 48 bit P.A.
• Most LANs use 48 bit P.A. In form of 12 Hexadecimal
digits 07:15:45:2C:55:T6
• Not suitable for Internetwork where diff networks have
diff network formats
• Changes from hop to hop
2.4
Physical Addresses

2.5
Logical Addresses
• Necessary for Universal Communication
• Independent of underlying Physical
Networks
• Each host identified uniquely irrespective of
underlying physical network
• Currently its of 32 bits and can uniquely
identify each host
• Remains same from hop to hop
2.6
Port Addresses
• IP add and Physical Add are necessary for the
quantity of data to travel from source to
destination.

• The end objective of communication is a process


communicating with another process.

• Processes need address to label them differently.


• In TCP/IP architecture label is assigned to process
and of 16 bits length
2.7
Port address is a 16-bit address represented by one decimal
number ranged from (0-65535) to choose a process among
multiple processes on the destination host.
Destination port number is needed for delivery.
Source port number is needed for receiving a reply as an
acknowledgments.
In TCP/IP , a 16-bit port address represented
as one single number. Example: 753

The physical addresses will change from hop to hop,


but the logical addresses and port address usually
remain the same.

2.8
Specific Addresses

• Some applications have user friendly address that


are designed for the specific address
• Eg. Email address (recipient of email)
URL (to find the document in WWW)

▪ These addresses get changed to the corresponding


port and logical address by the sending computer.
The Domain Name System (DNS) translates human-friendly
computer hostnames ( URL) into IP addresses. For example,
www.example.com is translated to 208.77.188.166
2.9
Relationship of Layers and Addresses in TCP/IP

2.10
Example 2.2

Most local-area networks use a 48-bit (6-byte) physical


address written as 12 hexadecimal digits; every byte (2
hexadecimal digits) is separated by a colon, as shown
below:

07:01:02:01:2C:4B

A 6-byte (12 hexadecimal digits) physical address.

2.11
Logical Addresses
• Necessary for Universal Communication
• Independent of underlying Physical
Networks
• Each host identified uniquely irrespective of
underlying physical network
• Currently its of 32 bits and can uniquely
identify each host
• Remains same from hop to hop
2.12
Classful Addressing
• IANA(Internet Assigned Number Authority)

• Classful Addressing system (IPv4 32 bits)


(Classes A,B,C,D,E)

Logical Addressing System


• MAC address can’t be used as an Identification
unit for Transmitting the data. Because every
company has their own way of representations.
• A new addressing scheme has been started by
IANA known as Classfull addressing system. This
classfull addressing scheme has classes A,B,C,D
and E.
• Classful addressing scheme follows 2 level
hierarchy.
2 Level Hierarchy System

Net ID

Host
Host
……….
Host Host

Entire Network is represented by NetID and when a


computer is given IP address (32 bits) it is treated as
Host.
Classfull Addressing
number

• Class A # of Networks # of Hosts in a Network

0 (27 -2) (224 -2)


8 bits 24 bits
Network Bits Host Bits

1 bit for Identification and 7


Network ID and DBA (Direct
bits remaining in Network
Broadcast Address)
bits

Loopback address (127.x.y.z)


and Default address/DHCP
client address(0.0.0.0)
excluded
Loopback Address
• A loopback address is a type of IP address that
is used to test the communication or
transportation medium on a local network
card and/or for testing network applications.
• In IPv4, 127.0.0.1 is the most commonly used
loopback address, however, this range can be
extended to 127.255.255.255.
• 127.0.0.1 has the one very specific purpose of
allowing a device to send messages to itself.
0.0.0.0 (DHCP Client Address)
• Instead of putting no IP address into the
network area of a program, 0.0.0.0 can be
used to mean anything from accept all IP
addresses or block all IP addresses to
the default route.
0 0000000 =0 • In binary notation (ex.
01001110.01000001.00101010.00000001),
first few bits decides the type of class.
0 1111111 =127 • In the Dotted decimal notation (ex.
172.56.45.61) , the first octet decides the
(0 – 127) type of class.
• 1 octet is 8 bits

(1-126) Class A
0 and 127 are special IP addresses so we have
subtracted 2 in the Network portion of Class A.
Class B
• Class B # of Networks # of Hosts in a Network

1 0 (214 ) (216 -2)


16 bits 16 bits
Network Bits Host Bits

2 bits for Identification and


Network ID and DBA
14 bits remaining in Network
(Distributed Broadcast
bits
Address)
Class B
10 000000 =128

10 111111 =191

(128-191) Class B Range


𝐼𝑛 𝑐𝑙𝑎𝑠𝑠 𝐵 𝑒𝑎𝑐ℎ 𝑛𝑒𝑡𝑤𝑜𝑟𝑘 𝑤𝑖𝑙𝑙 ℎ𝑎𝑣𝑒 216 −2
hosts.
Class C
# of Networks # of Hosts in a Network

11 0 (221 ) (28 -2)


24 bits 8 bits
Network Bits Host Bits

3 bits for Identification and


Network ID and DBA
21 bits remaining in Network
(Distributed Broadcast
bits
Address)
Class C
110 000000 =192

110 111111 =223

(192-223) Class C Range


𝐼𝑛 𝑐𝑙𝑎𝑠𝑠 𝐶, 𝑒𝑎𝑐ℎ 𝑛𝑒𝑡𝑤𝑜𝑟𝑘 𝑤𝑖𝑙𝑙 ℎ𝑎𝑣𝑒 28 −2 hosts.
NOTE: A computer is given an IP address from Class
A/B/C.
Class D
• 1110…………….

• 1110 0000=224

1110 1111=239
(224-239) Class D Range
• This IP is not given to any computer.
• No N/W bits and Host bits division.
• Classes A, B and C are used for Unicasting and
Class D is used for Multicasting.
Class E
• Used for Research purpose.
1111….
Not A
Not D
Not B Not C

1111 0000=240 Class E range: 240-255

1111 1111=255
Network Mask/ Default Mask
• Network Mask is a mathematical tool which
can solve some of the networking problems.
• For masking: In network bits place all 1’s and
in Host bits place all 0’s.
Class A
• Network Bits Host Bits

11111111 00000000 0000000 0000000


Mask: 255 . 0 . 0 . 0
Class B
• Network Bits Host Bits

11111111 11111111 0000000 0000000


Mask: 255 . 255 . 0 . 0
Class C
• Network Bits Host Bits

11111111 11111111 11111111 0000000


Mask: 255 . 255 . 255 . 0

In Class D and E there are no Host or Network


Bits therefore they have NO MASK.
How to calculate Network ID?
• Perform Bitwise AND operation between IP
address and Network Mask to get Network ID.
IP Address
(AND) Mask
Network ID
• EX: Ip address= 201.15.19.62
Netid=?
DBA=?
Hint: Firstly identify Class from the 1st octet of IP
address.
IP address: 201.15.19.62  Through 1 st octet we got to
know its class C and we will use Class C mask

Mask: 255.255.255.0  Class C Mask


Net ID: 201.15.19.0
2 Level Hierarchy Reserved IP address for Direct
Broadcast Address: 201.15.19.255

201.15.19.0 = Net ID

201.15.19.1 201.15.19.254
201.15.19.2
Host
Host Host
• In Host you can’t use 201.15.19.0 because it is
used as Net ID and 201.15.19.255 is used as
DBA.
• We have subtracted 2 from No. of Hosts
because one is used as NetID and the other is
used as DBA of the N/W.

For a NetID, Host bits will always be 0’s and for a


DBA, Host bits will always be 1’s.
From IP address we can directly find the NetID and DBA.
Step 1: Find the class.
Step 2: After finding class calculate NetID and DBA

Example
1. IP : 59.63.120.119
What is the Network ID and DBA?
IP Address

Private IP address Public IP address

Used in LAN network Used for providing


for connection Internet Service
Private IP address
• 10.0.0.0. to 10.255.255.255 224 IP addresses
• 172.16.0.0 to 172.31.255.255 220 IP addresses
• 192.168.0.0 to 192.168.255.255 216 IP addresses

1. Private IP addresses are free of cost. Any organization can use an address out of
this set without permission from the Internet authorities. They are unique inside
an organization but not unique globally. No router will forward a packet that has
one of these addresses as Destination address.
2. In a LAN, one computer acts as Server and rest act as Client. This server has group
of private IP addresses and assigns it to the hosts in the LAN network.
3. Scope of Private IP is LOCAL. These IP’s won’t work outside the LAN. Some IP’s can
be repeatedly used in different LANs.
4. In every LAN network, private IP’s are used. Same private IP’s can be used in other
LANs because the scope is Local.
• Public IP Address- provides Internet Service

ISP Router
X Google
Server
Public IP provided 16.7.1.8
to College
X 144.15.16.8

NAT Router Network address


Converts Public IP to translation (NAT) is a method
Private IP and Vice of remapping one IP address
versa and only 1 space into another by
router i.e. NAT router modifying network
is connected to address information
Global in Internet
10.0.0.9
10.0.0.5 Protocol (IP) datagram
packet headers while they
Data 10.0.0.5 16.7.1.8 are in transit across a
traffic routing device.
• We want to provide Network 10 an Internet Connection. So,
to get Internet it will contact ISP router. ISP router provides a
public IP to the college (144.15.16.19)
• Data 10.0.0.5 16.7.1.8 This is the packet
made by a Host in
Public IP LAN 10.
Private IP
• Google can understand only the public IP’s and not private
IP’s.
• So the router will remove the private IP before forwarding and
attaches the public IP address provided by ISP.
Data 10.0.0.5 16.7.1.8

144.15.16.19
• NAT Router converts private IP into public IP when the
packet is going outside the Network and it converts
public IP into private IP when the packet is coming
inside the Router.
• NAT Router can understand that which computer in
LAN is transmitting by using MAC address. Every
computer’s private IP address is converted into same
public IP but it can internally distinguish different
clients with the help of MAC Address.
• Identification of a system in Network Environment can
be done by IP address and Identification of a process in
Network Environment can be done by Port address
which is given by TCP/IP software.
• Purpose of private IP addresses are to efficiently utilize
the public IP addresses,
Drawback of Classfull Addressing
• Class A has 27 -2 networks and each network has 224 -2
hosts i.e. 1.5 Crores (Wastage---Because If u want
10,000 IP’s of class A then many addresses of Class A
are wasted).
• Class B has 214 networks and each network has 216 -2
hosts. (Wastage---Because If u want 10,000 IP’s of class
B then many addresses 55534 of Class B are wasted).
SOLUTION is SUBNETTING.
• Class C has 221 networks and each network has 28 -2
hosts=254. IP addresses are not sufficient to the
requirement of users because for 1000 hosts 254 are
not enough. SOLUTION is SUPERNETTING.
Subnetting
• Dividing a large network into smaller network
for efficient utilization of IP addresses is
known as Subnetting.
• Subnet Mask is used in Subnetting.
• Ex. In class C, if subnet mask is
255.255.255.224 then no. of Subnets=? And
no. of hosts in each subnet=?
• Subnet Mask: 255.255.255.224
Class C Host Bits

11111111.1111111.11111111.11100000

Network Bits Subnet Bits

Default Mask of Class C:


255.255.255.0

Network Bits Host Bits

During Subnetting, Subnet bits are borrowed from Host portion.


• Subnet Mask: 255.255.255.224 and Class is C
(GIVEN)
# of Subnets= 23 -2=6
# of hosts in each subnet=25 -2=30
Ex 2. In class C if subnet mask is 255.255.255.240
then calculate # of subnets and #of hosts in each
subnet.
Default Mask of Class C=255.255.255.0 (Last Octet
is 00000000)
Subnet Mask=255.255.255.240(Last Octet is
11110000) 4 bits which are 1 are subnet bits and
rest are host bits.
# of Subnets= 24 -2=14 subnets
# of hosts in each subnet= 24 -2=14 hosts
Ex. In class B if subnet mask is 255.255.252.0
then # of Subnets and # of hosts in each subnet?
IP Address
(AND)Subnet Mask
Subnet ID
We are subtracting 2 from the # of hosts in each
subnet because one is used as subnet id and
other is used as Direct Broadcast address of that
subnet
Classless Addressing
• Designing is easier here
• No classes, Only blocks
• Block→ Group of IP addresses
• In classless addressing the IP address notation is
x.y.z.w/n: CIDR notation (Classless Interdomain
Routing)
• n: is the number of bits used for NetID part.
• IP address is of 32 bits then #of addresses possible
in Classless Addressing scheme is232−𝑛 .
• Ex. 121.71.36.15/26 Classless Notation
IP address of Computer Mask(26 continuous 1’s)

Mask: 11111111 11111111 11111111 11000000 (26 1’s and 6 0’s)

• What is the hexadecimal notation of the classless mask? What


are the no. of addresses possible if the mask is n?
• Ex. 121.21.56.78/28
Mask=255.255.255.240 n
#of addresses=232−28 = 16.
Ex.121.21.56.78/30
Mask=255.255.255.252
n
#of addresses=232−30 = 4.
Rules of Classless Addressing
1. The addresses in a block should be
continuous.
2. The first address of a block should be exactly
divisible by no. of addresses in a block.
3. Size of block must be power of 2.
4. # of addresses in a block=232−𝑛 where n is
the mask value.
Ex. If one of the address of a block is
210.15.79.89/26 then no. of addresses in a
block?
Ans: # of addresses in a block=232−26 =26 =64
Transmission
Time

Propagation
Time
Source Destination

Transmission Time: Time taken for placing the


data on cable.
Propagation Time: Time taken to propagate the
data on cable.
# T.T. depends on the data size and Bandwidth of
cable.
• T.T. is the property or characteristic of the
computer i.e. transmitting because computer
is placing data on cable.
• EX. For fibre optic cable– Bandwidth
therefore T.T.
• For Twisted Pair cable -- Bandwidth
therefore T.T.
• Transmission Time (T.T)= 𝐷𝑎𝑡𝑎 𝑆𝑖𝑧𝑒 (𝐿)
𝐵𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ (𝐵)
• In data transfer, Kilo specifies 103
• In data storage, Kilo specifies 210
• Inside Computer we use base 2 and inside
wire we use base 10.
• Ex. Data Size=1000 bits and
Bandwidth=10Mbps then T.T=?
Ans= 100µs
• Propagation Time (P.T.)= Propagation time
depends on the distance and velocity. It is the
time taken by a bit to travel from 1 end of the
wire to another. Velocity depends on the
medium.
𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 (𝑑)
P.T.=
𝑉𝑒𝑙𝑜𝑐𝑖𝑡𝑦 (𝑣)

• P.T. is the property of cable/medium and


doesn’t depend on the data we transmit.
Concept of T.T. and P.T.
• Total time to send the data to destination and
getting the acknowledgement is T.T.+P.T.+P.T.=2
T.P.+T.T.
• P.T.ack=P.T.data and T.T.ack<<<T.T. data.
• Total time=T.T. +2 T.P.
𝑇.𝑇.
• Link Utilization =
𝑇.𝑇.+2 𝑇.𝑃.
𝑇.𝑇.
• % of Link Utilization of Sender= *100
𝑇.𝑇.+2 𝑇.𝑃.
• Computer is utilizing the channel only once just
for placing the data that’s why numerator is T.T.
Numericals
Ques. For a 10Mbps Ethernet link, if the length of the packet is
32bits, the transmission delay is(in milliseconds)
Ans: 3.2
Ques. In the transfer of file between server and client, if the
transmission rates along the path is 10Mbps, 20Mbps,
30Mbps, 40Mbps. The throughput is usually
a) 20Mbps
b) 10Mbps
c) 40Mbps
d) 50Mbps
Ans: b
reason: The throughput is generally the transmission rate of
bottleneck link.
Definitions

• Link bandwidth (capacity): maximum rate (in bps) at which the


sender can send data along the link
• Propagation delay: time it takes the signal to travel from source
to destination
• Packet transmission time: time it takes the sender to transmit
all bits of the packet
• Queuing delay: time the packet need to wait before being
transmitted because the queue was not empty when it arrived
• Processing Time: time it takes a router/switch to process the
packet header, manage memory, etc

52
• Bit rate units:
1Kbps = 103bps
1Mbps = 106bps
1 Gbps = 109bps
[For memory: 1 Kbyte = 210 bytes = 1024 bytes]
Delay Related Metrics
• Delay (Latency) of bit (packet, file) from A to B
– The time required for bit (packet, file) to go from A to
B
• Jitter
– Variability in delay
• Round-Trip Time (RTT)
– Two-way delay from sender to receiver and back
• Bandwidth-Delay product
– Product of bandwidth and delay → “storage” capacity
of network

54
SCTP
• Stream Control Transmission Protocol (SCTP) is a new
reliable, message-oriented transport layer protocol. SCTP,
however, is mostly designed for Internet applications that have
recently been introduced.

23.55
Figure 23.27 Multiple-stream concept
SCTP
• SCTP association allows multiple IP addresses
for each end.
• In SCTP, control information and data
information are carried in separate chunks.

You might also like