0% found this document useful (0 votes)
34 views80 pages

05 Network Layer Part 01

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views80 pages

05 Network Layer Part 01

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Sri Lanka Institute of Information Technology

Faculty of Computing

Network Layer – Part 01


Ms. Shashika Lokuliyana
Year 01 and Semester 01

Year 01 Semester 01 11
Lesson outline
• Network layer functions
• Protocols used at the network layer
• IPv4 - IP protocol version 4: datagram format
• IPv4 fragmentation and reassembly
• IPv4 addresses
• IPv4 subnetting and address allocation
• Network Address Translation (NAT)

2
Key terms and concepts
• IPv4 (Internet Protocol version 4)
• Subnetting
• Network Address Translation (NAT)
• Datagram
• Fragmentation and Reassembly
• ICMP (Internet Control Message Protocol)
• CIDR (Classless Inter-Domain Routing)
• TTL (Time To Live)
• IP Header
• Routing and Forwarding
3
Network-layer services and protocols
▪ deliver the transport layer mobile network
segments from sending host to national or global ISP
receiving host
• sender: encapsulates segments
into datagrams, passes to link layer application
transport
• receiver: delivers segments to network
link
transport layer protocol physical
network network

▪ network layer protocols in every


link link
physical physical

Internet device: hosts, routers


▪ routers:
network
link network
physical link
physical network

• examines header fields in all IP link


physical
datacenter
network
datagrams passing through it
• moves datagrams from one port application
transport
(input) to another port (output) to enterprise
network
link
transfer datagrams along the path network physical

from sender to receiver


4
Network Layer Functions
network-layer functions: analogy: taking a trip
• forwarding: move packets from ▪ forwarding: process of getting
a router’s input link to through a single interchange or
appropriate router output link junction
▪ routing: determine route taken ▪ routing: process of planning a
by packets from source to trip from source to destination
destination
• routing algorithms

forwarding routing

5
Network Layer: Internet
Functions of the network layer of hosts and routers:

transport layer: TCP, UDP

IP protocol
Path-selection • datagram format
algorithms: • addressing
network implemented in • packet handling conventions
• routing protocols forwarding
layer (OSPF, BGP) table ICMP protocol
• SDN controller • error reporting
• router “signaling”

link layer
physical layer

6
Protocols used in IP networks
• Datagram delivery system on IP networks is an unreliable, best-
effort, and connectionless
• Unreliable: Delivery is not guaranteed
• Best effort: Some datagrams may be dropped due to congestion etc.
• Connectionless: Each datagram is treated independently from others
• The protocol used for data transfer is the Internet Protocol (IP)
• The ICMP (Internet Control Message Protocol) is used for control
• IP, ICMP, and a few other protocols are used in the network layer

7
IP Datagram format
32 bits
IP protocol version number total datagram
ver head. type of length length (bytes)
header length(bytes) len service
fragment fragmentation/
“type” of service: 16-bit identifier flgs
▪ diffserv (0:5)
offset reassembly
time to upper header
▪ ECN (6:7) header checksum
live layer checksum
TTL: remaining max hops source IP address 32-bit source IP address
(decremented at each router)
destination IP address 32-bit destination IP address
upper layer protocol (e.g., TCP or UDP)
options (if any) e.g., timestamp, record
overhead route taken
▪ 20 bytes of TCP payload data
▪ 20 bytes of IP Maximum length: 64K bytes
(variable length, Typically: 1500 bytes or less
▪ = 40 bytes + app typically a TCP
layer overhead for or UDP segment)
TCP+IP
8
Fields of an IP datagram
• Version (4 bits): 0100 for IPv4
• Internet Header Length (IHL) (4 bits): The length of the header in
32-bit words
• Type of Service (TOS) (8 bits): The type of service desired by the
sender
• Precedence (3 bits): Indicates the priority or the importance of the
datagram (7 is highest)
• Delay (1 bit): If set to 1 low delay is desired
• Throughput (1 bit): If set to 1 high throughput is desired
• Reliability (1 bit): If set to 1 high reliability is desired
• Total Length (16 bits): The total length of the datagram in octets
• Identification (16 bits): A sequence number that (together with SA,
DA, and Protocol fields) will uniquely identify the datagram
9
Fields of an IP datagram (2)
• Flags (3 bits): Only two flags are used at present
• More Fragments (MF) (1 bit)
• Don't Fragment (DF) (1 bit)
• Unused (1 bit)
• Fragment offset (13 bits): Indicates the location of this fragment in
the original datagram, measured in 64-bit units (explained later)
• Time To Live (TTL) (8 bits): Indicates the maximum number of hops
that the datagram may traverse on the Internet
• Each router should decrement the TTL by 1
• Protocol (8 bits): Specifies the higher layer protocol that is to
receive this datagram at the receiver
• 2=ICMP, 6=TCP, ...
10
Fields of an IP datagram (3)
• Header checksum (16 bits): Used for error control. Computed as
follows
• Treat the header as a sequence of 16 bit integers (assume header checksum=0
for this computation)
• Add the integers using 1's complement arithmetic
• Take the 1's complement of the result
• Source Address (SA) (32 bits): IP address of the sender
• Destination Address (DA) (32 bits): IP address of the recipient
• Options (variable): Allows extensions of the IP protocol (e.g. Record
route, Timestamp). Length depends on the options selected
• Padding (variable): Filled with 0s to make the header length an exact
multiple of 32-bit words). Not needed if no options.
• Data (variable): The actual data
• Must be an integer multiple of octets
• Maximum size is 65,515 octets

11
MTU of Link layers
• Many link layer protocols limit the length of the payload section of the frame
• This is called Maximum Transfer Unit or MTU
• As a result, the payload of an IP datagram is limited to MTU – IP Header Length
(The IP datagram standard header length is 20 bytes, with no Options)
• For Ethernet, MTU is 1500 bytes, and payload of an IP datagram is limited to 1480 bytes
• But the length of an IP datagram can be (2 16 -1= 65535) because the length
field of the IP header is 16 bits
• How do we fit large IP datagrams in links with low MTU?
• Fragmentation and Reassembly

12
Fragmentation and reassembly
• If an IP datagram is larger than the MTU of the link on which the datagram
is going out, the datagram must be fragmented
• Fragmentation can happen at the sending host, or at any of the routers along the
path to the destination host
• A fragmented datagram may itself be fragmented if it encounters a network with
an even smaller MTU
• So, a datagram may be fragmented several times before it reaches the final
destination
• The reassembly of fragments is done only at the destination host
• each fragment becomes an independent datagram and can travel through
different routes
• So, it is only possible do the reassembly at the final destination
• IP header fields and flags used for fragmentation and reassembly
• Identification (16 bits)
• Fragment Offset (13 bits)
• Don’t Fragment (DF) bit in the Flags field
• More Fragments (MF) bit in the Flags field
13
IP addressing: introduction
223.1.1.1

• IP address: 32-bit identifier 223.1.2.1


associated with each host or 223.1.1.2
router interface 223.1.1.4 223.1.2.9

• interface: connection between 223.1.1.3


223.1.3.27

host/router and physical link 223.1.2.2

• routers typically have multiple


interfaces 223.1.3.1 223.1.3.2

• hosts typically have one or two


interfaces (e.g., wired Ethernet,
wireless 802.11) dotted-decimal IP address notation:
223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 1 1
14
IP addressing: introduction
223.1.1.1

Q: how are interfaces 223.1.2.1

actually connected? 223.1.1.2


223.1.1.4 223.1.2.9
A: Via a switch or a A: wired
wireless access Ethernet interfaces
connected by 223.1.3.27
point (base station) Ethernet switches
223.1.1.3
223.1.2.2

223.1.3.1 223.1.3.2

A: wireless WiFi interfaces


connected by WiFi base station

15
Subnets
223.1.1.1

▪ What’s a subnet ? 223.1.2.1

• device interfaces that can 223.1.1.2


223.1.1.4 223.1.2.9
physically reach each other
without passing through an 223.1.3.27

intervening router
223.1.1.3
223.1.2.2

• The term subnet is short for


subnetwork, and historically meant
that it is a part of a larger IP network 223.1.3.1 223.1.3.2

• But now the term is used to refer to


any IP network, even if it is not a part
of a larger IP network network consisting of 3 subnets
• So, in current use:
subnet = IP network
16
Host configuration
223.1.1.1
• A host must have an IP address to Subnet A
communicate with others on its subnet or
outside its subnet
223.1.2.1

• To communicate outside the host’s own 223.1.1.2

subnet, it must also know the IP address of


223.1.1.4 223.1.2.9

the default router


• The host will forward all IP datagrams with a 223.1.3.27
destination outside its own subnet to the default 223.1.1.3
223.1.2.2
router
• Minimum host configuration includes
• IP address and netmask 223.1.3.1 223.1.3.2
• Default router address
• DNS server addresses (will be discussed later)
• Static configuration: Administrator sets the
above in the network configuration part of Default router address for all hosts on
the host’s operating system subnet A is 223.1.1.4
• Dynamic configuration: Hosts use Dynamic Exercise:
Host Configuration Protocol (DHCP) to What should be the default router
dynamically get the above from a server addresses for hosts on the other two
subnets? 17
Host configuration: Exercise
• Connect to the SLIIT-STD WiFi network from your notebook or
mobile
• Find the host configuration of your device
• On iPhone devices, go to Settings -> Wi-Fi and then tap on i icon next to
SLIIT-STD
• On Android devices, go to Settings -> Wi-Fi and Network Connections and
then tap on the SLIIT-STD network name
• On notebooks go to Control Panel / System settings and see properties of
the wireless network interface
• Fill the form <to lecturer: provide a form URL on courseweb>

18
IP address notation
• We have seen IP address ranges expressed in the format a.b.c.d/x
• It is called the CIDR (Classless Inter Domain Routing) notation
• Any trailing zeros in the prefix (i.e. a.b.c.d) can be omitted
• 223.1.1.0/24 may be written as 223.1.1/24
• 10.0.0.0/8 may be written as 10/8
• 10.0.2.0/24 can be written as 10.0.2/24 but not as 10.2/24
• The notation is used for subnet addresses and host addresses
• If the host part is non-zero or the prefix length is 32, it is a host address
• Otherwise, it is a subnet address
• 223.1.1.0/24 is a subnet address as the host part is all zeros
• 223.1.1.12/24 is a host address because the host part is non-zero
• 0.0.0.0/32 is a host address because prefix length is 32
19
Exercise
Change the following IP address from binary notation to dotted
decimal notation.

10000001 00001011 00001011 11101111

20
Exercise
Change the following IP address from dotted decimal notation to
binary notation.

111.56.45.78

21
Exercise
Find the error, if any, in the following IP addresses:

a. 111.56.045.78
b. 221.34.7.8.20
c. 75.45.301.14
d. 11100010.23.14.67

22
Classful Addressing
▪ When IP addressing was first introduced, all IPv4 addresses were
divided into 5 classes.

Class Usage
Class A General purpose
Class B General purpose
Class C General purpose
Class D Multicasting
Class E Reserved for future use

23
Finding the class in binary notation

24
Exercise
Find the class of the address:

00000001 00001011 00001011 11101111

25
Finding the class in decimal notation

26
Exercise
Find the class of the address:

227.12.14.87

27
Network ID (aka Net ID) and Host ID
▪ When an organization reserves a set of IP addresses from their ISP
(Internet Service Provider) to use for the hosts used within that
organization, each IP address consist of two parts.

Network ID Host ID

This will identify the organization


This part will be unique to each
and will be common in all the hosts
host
within that organization

28
Net ID and Host ID cont.
▪ To accommodate the above need, the three general purpose IPv4
address classes (i.e. Class A, B and C) are allocated as shown
below.

29
Class A
▪ Consider the situation where a class A address is reserved for a
particular organization.

▪ With a class A address we can go up to 224 host addresses (i.e. 3 bytes


for host ID). This means the organization is getting 16777216 host
addresses with a class A address.

▪ However, we know that it will be an extremely rare situation, where a


single organization is occupying so many computers.

▪ Hence, when reserving class A addresses, millions of addresses are


unused and wasted.

30
Class B
▪ Now consider the situation where a class B address is reserved for
a particular organization.

▪ There are 2 bytes reserved for the host ID and hence, there are 216
= 65536 addresses for the organization to use in their hosts.

▪ Again it is rare to have an organization which will occupy such a


high number of computers.

▪ Hence, when reserving class B addresses, many addresses are


unused and wasted.

31
Class C
▪ Finally, consider the situation where a class C address is reserved for
an organization.

▪ With class C, we get only 1 byte for the host ID. Hence we can go up to
28 = 256 host addresses.

▪ However, for a fairly large organization this will not be enough. They will
have more than 256 computers which need IP addresses.

▪ Hence, the number of addresses in class C is smaller than the needs


of most organizations.

32
Class A, B and C Summary

Class Number of Number of Hosts


Networks Per Network
A 128 16777216
B 16384 65536
C 2097152 256

33
Exercise
Given the IP address 17.0.0.0, find the class, the net ID, and the
range of the addresses.

34
Masking Concept
▪ When we look at a classful IP address, we can easily say to which
class that IP address is belonging to and there by what is the net
ID of that IP address.

▪ Finding the net ID is extremely important since net ID is used by


routers to route the packets from one LAN to another LAN over the
Internet (Remember routers are used to interconnect LANs).

▪ Each LAN is owned by a particular organization, and the net ID is


what differentiates one LAN from another in Internet terms.

35
Masking Concept cont.
▪ Although we humans can easily interpret the net ID of a given
classful IP address, how does a router calculate the net ID?

▪ For this we use the concept of masking.

Bitwise AND operation i.e. the Net ID

36
Default Masks

Mask in
Mask in dotted
Class Mask in binary slash (/)
decimal
notation
A 11111111 00000000 00000000 00000000 255.0.0.0 /8
B 11111111 11111111 00000000 00000000 255.255.0.0 /16
C 11111111 11111111 11111111 00000000 255.255.255.0 /24

37
Exercises
▪ Given the address 23.56.7.91, find the network address.

▪ Given the address 132.6.17.85, find the network address.

▪ Given the address 201.180.56.5, find the network address.

38
Special IPv4 Addresses
▪ As shown in the below table, some IPv4 addresses are used for
special purposes.

39
Special IPv4 Addresses cont.
Network Address
▪ We already discussed what network address is and how a router
finds the network address by ANDing the given IP address with the
mask.

40
Special IPv4 Addresses cont.
Direct Broadcast Address (aka Broadcast Address)

▪ This is also commonly referred to as the broadcast address of the given


network.

41
Special IPv4 Addresses cont.
Limited Broadcast Address

42
Special IPv4 Addresses cont.
Loopback Address

▪ The most widely used loopback address is 127.0.0.1

43
Public Addresses vs. Private Addresses
▪ Internet is a public network and no two machines connected to
the internet can have the same IP address.

▪ Therefore, the IP addresses we use for machines that are directly


connected to the Internet are called Public IP Addresses.

▪ However, in some organizations, the computers may not be


directly connected to the Internet. In this case, these computers
will be assigned Private IP Addresses.

▪ The important thing is to understand, why use such a separation?

44
Why Public and Private Addresses?
Can use the same
private addresses in
Uses Private Addresses both LANs

LAN 1 LAN 2

Need to convert the


Private Addresses to
Public Addresses when
sending to Internet
Internet
Uses Public Addresses

45
IPv4 Private Address Ranges
▪ In IPv4, class A, B and C, following ranges are reserved to be used
in Local Area Networks for private addresses.

▪ Remember:
❑You cannot use these ranges for machines/interfaces that are directly
connected to Internet.

46
Problems with Classful Addressing
▪ Class A and B are too large for typical organizations and many IP
addresses will not be used and wasted.

▪ Class C is not enough for most organizations resulting the reservation


of at least a Class B address range for the organization.

▪ The end result is that, the available IP addresses are depleting at an


alarming rate and soon there will be no more IP addresses.

▪ Solutions:
❑ Short Term:
➢ Subnetting
➢ Classless Addressing
❑ Long Term: IPv6

47
Subnetting
▪ Subnetting is one way of saving IP addresses. To understand
subnetting let’s take the following scenario.

Example
❑A large organization has three departments. Namely, Finance, Engineering
and Sales.
❑Each department has 500 computers.
❑The network administrators have finalized to keep the three departments in
three separate LANs for ease of administration.

▪ What if we use classful addressing?

48
Solution with Classful Addressing
▪ Can we use class C addresses? No.

▪ Why?

▪ What are our options?


▪ Take 3 class B addresses…!!!
▪ What is the downside?

49
A better solution: Subnetting
▪ Take one class B network address and divide it to three
subnetworks.

▪ How?

▪ Get part of the


host ID portion
and use it as a
subnet ID.

50
The better solution
▪ The ISP has given the class B network address 141.14.0.0 for our
organization.

▪ We have three department, so we need at least 3 different network


addresses.

▪ For 3 addresses we need at least 2 bits (since 22 = 4).

141 14 XXYY YYYY YYYY YYYY

Class B address First 2 bits of host ID


given by ISP used for subnetworks
51
The better solution cont.
▪ Now we have 4 subnetworks,
❑141.14.0.0 (141.14.0000 0000.0) => Finance
❑141.14.64.0 (141.14.0100 0000.0) => Engineering
❑141.14.128.0 (141.14.1000 0000.0) => Sales
❑141.14.192.0 (141.14.1100 0000.0) => Not used

▪ And each department can have up to 214 IP addresses (since we


are left out with 14 host ID bits).

▪ However, as per the question, each department only needs 500


addresses. Hence, still there is a huge waste of IP addresses.

▪ So, subnetting, although a solution, is not the best solution.

52
Subnet Mask

53
Exercise
What is the subnetwork address if the destination address is
200.45.34.56 and the subnet mask is 255.255.240.0?

54
Classless Addressing
▪ Classless addressing is often confused with subnetting.

▪ Remember that in subnetting,


❑A classful address is chosen.
❑This classful address is further sub-divided into subnetworks.

▪ In classless addressing there is no concept of classes at all.

55
Format of a Classless Address

▪ This format is also known as Classless Inter


Domain Routing (CIDR) notation.

56
Prefix Length - /n
▪ As said earlier, in classless addressing, there is no concept of
classes.

▪ Therefore, how do we identify which part of the IP address is the


network address and which part is the host address?

▪ This is where prefix length is used.

Network Address Host Address

Prefix Length - /n
57
All possible /n s

Classful addressing is a special case of


classless addressing.
58
Exercises
▪ What is the first host address in the block if one of the addresses
is 167.199.170.82/27?

▪ What is the first host address in the block if one of the addresses
is 140.120.84.24/20?

▪ Find the number of host addresses in the block if one of the


addresses is 140.120.84.24/20.

▪ Find the last host address in the block if one of the addresses is
140.120.84.24/20.

59
Exercises
▪ If one of the addresses is 190.87.140.202/29,
❑What is the network address?
❑What is the first host address?
❑What is the last host address?

▪ This example will show you that,

In classless addressing, the last address


in the block does not necessarily end in
255.
60
Subnetting a Classless Address
Variable Length Subnet Masking
▪ Classless addresses too, can be sub-divided into smaller
subnetwork addresses.

▪ However, unlike subnetting a classful network address, we have


the flexibility in varying the subnet mask continously as per our
requirement.

▪ Hence, subnetting a classless network address is known as


Variable Length Subnet Masking (VLSM).

▪ The best way to understand VLSM is to take an example.

61
VLSM
Example 1
An organization is granted a block of addresses with the beginning
address 14.24.74.0/24. There are 232−24 = 256 addresses in this
block. The organization needs to have 11 subnets as shown below:

a. two subnets, each with 64 addresses.


b. two subnets, each with 32 addresses.
c. three subnets, each with 16 addresses.
d. four subnets, each with 4 addresses.

Design the subnets.

62
VLSM
Example 2
Assume a company has three offices: Central, East, and West. The
Central office is connected to the East and West offices via private,
point-to-point WAN lines. The company is granted a block of 64
addresses with the beginning address 70.12.100.128/26. The
management has decided to allocate 32 addresses for the Central
office and divides the rest of addresses between the two offices.

Design the subnets.

63
Address Allocation
Who allocates IP addresses?
▪ Who has the authority to provide you an IP address?

▪ Answer: Internet Service Provider (e.g. Sri Lanka Telecom).

▪ Who has the authority to reserve IP addresses to each ISP?

▪ Answer: A global authority called the Internet Corporation for


Assigned Names and Addresses (ICANN).

64
Getting IP address space for your network
• What IP address space can you use for a particular network?
• For communications within a private network (network of an organization or
a home network) we can use private address space
• 10/8, 172.16/12 and 192.168/16
• But to communicate outside your private network, a host needs an address
other than a private IP address
• Such addresses are called public IP addresses or globally routable unicast addresses
• To use a public IP address space you must have that space allocated or
assigned to you
• You can get an IP address space allocated to you by an Internet registrar
(usually for an annual payment)
• But currently the IPv4 address space is fully exhausted
• Your Internet Service Provider (ISP) will also permit you to use an address or
a range of addresses from their IP address allocation (which they have got
from an Internet registrar)
• But they will usually not provide one public address for each host in your network(s)
• The common practice tpday is to use Private IP addresses within your network and use
Network Address Translation (NAT) with a few public IP addresses provided by your ISP
65
NAT: network address translation
▪ all devices in local network have 32-bit addresses in a “private”
IP address space (10/8, 172.16/12, 192.168/16 prefixes) that
can only be used in local network
▪ advantages:
▪ just one IP address needed from provider ISP for all devices
▪ can change addresses of host in local network without
notifying outside world
▪ can change ISP without changing addresses of devices in
local network
▪ security: devices inside local net not directly addressable,
visible by outside world

66
NAT: network address translation
implementation: NAT router must (transparently):
▪ outgoing datagrams: replace source IP address of every outgoing
datagram to NAT IP address
• remote clients/servers will respond using NAT IP address as
destination address
▪ remember (in NAT translation table) every source IP address to NAT IP
address translation pair
▪ incoming datagrams: replace NAT IP address in destination fields of
every incoming datagram with corresponding source IP address stored
in NAT table
67
NAT: network address translation
2: NAT router changes
datagram source address from NAT translation table
1: host 10.0.0.1 sends
10.0.0.1 to 138.76.29.7 and Outside addr Inside addr datagram to
updates translation table. 138.76.29.7 10.0.0.1 128.119.40.186
(Router has been told that it …… ……
can use 138.76.29.7)
S: 10.0.0.1
Actually, to share one D: 128.119.40.186
public IP address 10.0.0.1
among many hosts, 1
S: 138.76.29.7
NAT changes the Layer 2 D: 128.119.40.186 10.0.0.4
10.0.0.2
4 port number in
addition to the Layer 3 138.76.29.7 S: 128.119.40.186
4
IP address. We will talk S: 128.119.40.186
D: 10.0.0.1
10.0.0.3
about this later, after D: 138.76.29.7 3
we have talked about 3: reply arrives at the NAT 4: NAT router looks up the table and
Layer 4 protocols TCP router with destination address changes datagram destination
and UDP 138.76.29.7 address from 138.76.29.7 to 10.0.0.1

68
NAT: Exercise
• Connect to the SLIIT-STD WiFi network from your notebook or
mobile
• Find the IP address of your device
• On iPhone devices, go to Settings -> Wi-Fi and then tap on i icon next to
SLIIT-STD
• On Android devices, go to Settings -> Wi-Fi and Network Connections and
then tap on the SLIIT-STD network name
• On notebooks go to Control Panel / System settings and see properties of
the wireless network interface
• Now open a browser on your device, and go to
whatismyipaddress.com
• This web page will show you the public IP address your NAT router is using
for your device.
• Fill the form <to lecturer: provide a form URL on courseweb>
69
Lesson summary
• The network layer is responsible for forwarding packets across a
network, ensuring they reach the correct destination through
routing and addressing mechanisms.
• Key protocols include IPv4, which handles packet formation and
addressing, and ICMP, used for control messages.
• The network layer also deals with challenges like fragmentation
and reassembly of packets to accommodate different Maximum
Transfer Units (MTUs) across networks.
• Subnetting and NAT are crucial for efficient IP address
management and enabling private networks to connect to the
internet.

70
References
• Chapter 4 - The Network Layer: Data Plane
James F. Kurose and Keith W. Ross, Computer Networking –
A Top-Down Approach, (8th Edition), Pearson, 2020

71
Additional Reading/Exercise

72
Reserved IP addresses / ranges
• 0.0.0.0/32 (all zeros): This host (me!)
• This can be used when a host is booting up until it gets a usable IP address
via DHCP or some other method Loopback
• 0.0.0.0/8: Local network (the network the host is in) interface
• 127.0.0.0/8: Used for loopback interfaces on a host
host
• A loopback interface connects a host to itself
• 169.254.0.0/16: Used for link-local addresses between two hosts
on a single link when no IP address is otherwise specified
• 10.0.0.0/8, 172.16.0.0/12 and192.168.0.0/16: Private IP addresses
Used for local communications within a private network
• 224.0.0.0/4: Used for multicast
• 255.255.255.255/32 (all 1s): broadcast address on “this” network
This is called the limited broadcast address
• Plus a few other ranges
73
Fragmentation and reassembly example
• Incoming IP datagram has ID=09FA (Hexadecimal), Length = 4000,
MTU of the outgoing link = 1500
• Payload of the incoming IP datagram = 4000 – 20 = 3980
• Maximum possible payload size of fragments = 1500 – 20 = 1480
• Break the incoming payload into three fragments of size 1480, 1480 and
1020 ( i.e 3980 = 1480 + 1480 + 1020)
• fragment offset is the position of the first byte in the fragment divided by 8
• For fragment 1 it is 0 / 8 = 0
• For fragment 2 it is 1480 / 8 = 185
• For fragment 3 it is 2960 / 8 = 370
• More Fragments (MF) field is set to 1 for all fragments except the last one
• ID field of the fragments is set to ID field of the incoming datagram ( = 09FA)

74
Fragmentation and reassembly example (ctd)
20 bytes 3980 bytes

0 1480 2960
ID=09FA Original datagram 20 bytes 1020 bytes
MF=0 ID=09FA
OFFSET=0 MF=0
OFFSET=370
2960 3979
Fragment 3

20 bytes 1480 bytes 20 bytes 1480 bytes


ID=09FA ID=09FA
MF=1 MF=1
OFFSET=0 OFFSET=185
0 1479 1480 2959
Fragment 1 Fragment 2
75
Exercise
Change the following IP addresses from binary notation to dotted
decimal notation.

a. 11000001 10000011 00011011 11111111


b. 11100111 11011011 10001011 01101111
c. 11111001 10011011 11111011 00001111

76
Exercise
Change the following IP addresses from dotted decimal notation to
binary notation.

a. 221.34.7.82
b. 241.8.56.12
c. 75.45.34.78

77
Exercise
Find the class of each address:

a. 11000001 10000011 00011011 11111111


b. 10100111 11011011 10001011 01101111
c. 11110011 10011011 11111011 00001111

78
Exercise
Find the class of each address:

a. 193.14.56.22
b. 14.23.120.8
c. 252.5.15.111
d. 134.11.78.56

79
Exercise
1. Given the IP address 132.21.0.0, find the class, the net ID, and
the range of the addresses.
2. Given the IP address 132.21.0.0, find the class, the net ID, and
the range of the addresses.

80

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy