Network Layer: Computer Science Department
Network Layer: Computer Science Department
1440-1441
Faculty of Sciences/Northern Borders University
2020-2021
Chapter IV
Network Layer
[email protected]
Computer Science Department
1
Network Layer
Computer Networks 2
IPv4 basic characteristics
Computer Networks 3
IPv4 basic characteristics
• Connectionless: An example of connectionless communication
is sending a letter to someone without notifying the recipient in
advance. The sender doesn't know if the letter arrived
• Best Effort (unreliable): Unreliable means simply that IP does
not have the capability to manage, and recover from,
undelivered or corrupt packets
• Media Independent: IP packets can travel over different media
Computer Networks 4
IP v4 Packet Header
• Version: Contains the IP version number (4 or 6)
• Header Length (IHL): Specifies the size of the packet header
• Type-of-Service: Contains an 8-bit binary value that is used to
determine the priority of each packet. This value enables a
Quality-of-Service (QoS) mechanism to be applied to high priority
packets, such as those carrying telephony voice data
• Packet Length: This field gives the entire packet size, including
header and data, in bytes
Computer Networks 5
IPv4 Packet Header
• Identification: This field is primarily used for uniquely identifying
fragments of an original IP packet
• Time-to-Live (TTL) is an 8-bit binary value that indicates the
remaining "life" of the packet. Its value is decreased by at least one
each time the packet is processed by a router (each hop)
• Protocol: this 8-bit binary value indicates the Network layer to pass
the data to the appropriate upper-layer protocol (01 ICMP, 06 TCP,
17 UDP, etc.)
• Header Checksum: The checksum field is used for error
checking the packet header
• IP Destination Address: this field contains a 32-bit binary value that
represents the packet destination host address
• IP Source Address: this field contains a 32-bit binary value that
represents the packet source host address
• Options: There is provision for additional fields in the IPv4 header to
provide other services but these are rarely used
Computer Networks 6
IPv4 Address
• An Internet address consists of 4 bytes (32 bits)
• Value coded on 32 bits and represented in the form of four
integers in decimal writing eg: 192.168.4.8
• Need structure in IP Address
• The first part identifies the network (net_id)
• The second part identifies a Host on that network (host_id)
Class
Computer Networks 7
IP address classes
byte 1 byte 2 byte 3 byte 4
Example 1:
193.147.136.95
Computer Networks 8
IP address classes
BYTE 1
00000000 01111111
From Until
Computer Networks 9
IP address classes
BYTES 1 et 2
10000000 . 00000000 10111111 . 11111111
From Until
Computer Networks 10
IP address classes
BYTES 1, 2 et 3
11000000 . 00000000 . 00000000
11011111 . 11111111 . 11111111
From Until
Computer Networks 11
IP address classes
Default Netmask
byte 1 byte 2 byte 3 byte 4
194.74.21
46
194.74.21.46
13
Computer Networks res_id host_id 13
IP address classes
Special and private addresses
Adresses between 0.0.0.0 and 255.255.255.255 are not all
valid to identify a host (machine).
Net-id Host-id Signification
Identifies the host that sends the
All ‘0’
datagram (BOOTP, DHCP)
All ‘1’ Broadcast in each network
Net-id All ‘0’ Network Address
Net-id all ‘1’ Broadcast in the specified network
All ‘0’ Host-id Identifies a host in a network
From Until
15
Computer Networks 15
IP address classes
Taking Into account the reserved addresses, the number of networks and
hosts present in Each class is:
Computer Networks 16
IP address classes
Example 3
How many hosts can be defined in the network 194.74.21.0 ?
194 . 74 . 21 . 1
194 . 74 . 21 . 2
194 . 74 . 21 . 3 28-2=
. 254
. possible hosts
.
194 . 74 . 21 . 254
Reserved for the broadcast
194 . 74 . 21 . 255
Computer Networks 17
IP address classes
Example 4
Computer Networks 18
IP address classes
Example 5 : how to interpret an address ?
Computer Networks 20
Example: Subnetting
Division into 4 sub networks (class C)
129.146.95.255
Computer Networks 23