SlideShare a Scribd company logo
Computer Networks Network Layer In The Internet by Abdul Ghaffar
Network Layer In The Internet Overview This section is TCP specific, It’s how the Internet works.  Defined by RFC 791. Most Popular Layer 3.
Network Layer In The Internet The Internet Protocol (IP) is a network layer protocol.  Hosts and gateways process packets called Internet datagrams (IP datagrams).  IP provides connectionless, best-effort delivery service to the layers above it.  The Transmission Control Protocol (TCP) is a transport layer protocol. Provides reliable stream service between processes on two machines.  It uses acknowledgments and retransmissions methods to overcome the unreliability of IP.  The Universal Datagram Protocol (UDP) is a Transport Layer Protocol.  It provides connectionless datagram service between processes.  The IP Protocol
Network Layer In The Internet INTERNET PROTOCOL  (IP) The goal of IP is to interconnect networks of diverse technologies and create a single, virtual network to which all hosts connect.  Hosts communicate with other hosts by handing datagrams to the IP layer;  The sender doesn't worry about the details of how the networks are actually interconnected.  IP provides unreliable, connectionless delivery service.  IP defines a universal packet called an Internet Datagram. The IPV4 Protocol All Internet hosts and gateways process IP datagrams.
Network Layer In The Internet 1. Version number (4-bits):  The current protocol version is 4. Including a version number allows a future version of IP be used along side the current version, facilitating migration to new protocols.  2. Header length (4-bits):   Length of the datagram header (excluding data) in 32-bit words.  The minimum length is 5 words = 20 bytes, but can be up to 15 words = 60 bytes, if options are used.  In practice, the length field is used to locate the start of the data portion of the datagram.  The IPV4 Protocol
Network Layer In The Internet 3. Type-of-service (8-bits):   (last 2 unused) A hint to the routing algorithms as to what type of service we desire.  Precedence (3-bits):  A priority indication, where 0 is the lowest and means normal service, while 7 is highest and is intended for network control messages (e.g., routing, congestion control).  Delay  (1-bit):  An Application can request low delay service (e.g., for interactive use).  Throughput  (1-bit): Application requests high throughput.  Reliability   (1-bit): Application requests high reliability.  The IPV4 Protocol
Network Layer In The Internet Note: These last three TOS bits will generally be mutually exclusive. Does setting the low-delay bit guarantee getting such service? No. The type-of-service field is meant as a request or hint to the routing algorithms, but does not guarantee that your request can be honored (e.g., there may not be a low-delay path available).  In practice, routers ignore the TOS field in IPV4. The IPV4 Protocol
Network Layer In The Internet 4. Total length (16-bits):  Total length of the IP datagram (in bytes), including data and header. The size of the data portion of the datagram is the total length minus the size of the header.  The IPV4 Protocol
Network Layer In The Internet 5 - 8. Identification (16-bits),  Flags (3-bits), Fragment offset (13-bits): These three fields are used for fragmentation and reassembly.  Gateways along a path are free to fragment datagrams as needed; hosts are required to reassemble fragments before passing complete datagrams to the higher layer protocols.  Each fragment contains a complete copy of the original datagram header plus some portion of the data.  A receiving host must match arriving fragments with the proper original datagram.  These fragments may be out of order and interleaved with other fragments.  All fragments of a datagram will have the same source and destination IP address The IPV4 Protocol
Network Layer In The Internet 5 - 8. Identification (16-bits),  Flags (3-bits),   Fragment offset (13-bits)  (Continued): The identification field uniquely identifies fragments of the same original datagram.  Whenever a host sends a datagram, it sets the identification field of the outgoing datagram and increments its local identification counter.  The offset field shows order of the fragments.  When a gateway fragments a datagram, it sets the offset field of each fragment to reflect at what data offset with respect to the original datagram the current fragment belongs. Fragmentation occurs in 8-byte chunks, so the offset holds the “chunk number”.  Gateways can further fragment fragments!  A 400-byte fragment having an offset of 300 chunks could be split into two 200-byte fragments having offsets of 300 and 325 chunks, respectively.  The IPV4 Protocol
Network Layer In The Internet We need to know when we’ve received all of the fragments.  To help with this, the flags field may contain:  A  Don't Fragment  indication (set by host, honored by gateways). (A 1-bit flag.)  The  More Fragments  field indicates that another fragment follows this one. This fragment is not the last fragment of the original datagram.  An unfragmented datagram has an offset of 0, and a More Fragment bit of 0.  The last fragment of a fragmented datagram contains More Fragment = Clear and the Offset non-zero.  Note:   The total length field of the IP header refers to the current datagram, not the original.  Thus, the More Fragment bit is needed in order for the recipient host to determine when it has all fragments of a datagram.  The IPV4 Protocol
Network Layer In The Internet 5 - 8. Identification (16-bits),  Flags (3-bits),   Fragment offset (13-bits)  (Continued): Example: Original Frame: IHL = 5, Length = 656, Fragment Offset = 0,  More = 0 Fragment 1: IHL = 5, Length = 256, Fragment Offset = 0,  More = 1 Fragment 2: IHL = 5, Length = 256, Fragment Offset = 32, More = 1 Fragment 3: IHL = 5, Length = 144, Fragment Offset = 64, More = 0 The IPV4 Protocol
Network Layer In The Internet 9. Time-to-live (8-bits):   A counter that is decremented by each gateway.  If this hop count reach 0, discard the datagram.  Originally, the time-to-live field was intended to reflect real time.  In practice, it is now a hop count.  The time-to-live field squashes looping packets.  It also guarantees that packets don't stay in the network for longer than 255 seconds, a property needed by higher layer protocols that reuse sequence numbers.  10. Protocol (8-bits):  What type of data the IP datagram carries (e.g., TCP, UDP, etc.).  Needed by the receiving IP to know the higher level service that will next handle the data. The IPV4 Protocol
Network Layer In The Internet 11. Header Checksum (16-bits):   A checksum of the IP header (excluding data).  The IP checksum is computed as follows:  Treat the data as a stream of 16-bit words Compute the 1's complement sum of the 16-bit words. Take the 1's complement of the computed sum.   It has the property that the order in which the 16-bit words are summed is irrelevant. We can place the checksum in a fixed location in the header, set it to zero, compute the checksum, and store its value in the checksum field.  On receipt of a datagram, the computed checksum calculated over the received packet should be zero The header must be recalculated at every router since the time_to_live field is decremented. The IPV4 Protocol
Network Layer In The Internet 12. Source address (32-bits):  Original sender's address. 13. Destination address (32-bits):   Datagram's ultimate destination.  The IP embedded datagram contains the source of the original sender (not the forwarding gateway) and the destination address of the ultimate destination.  The IPV4 Protocol
Network Layer In The Internet 14.  IP Options IP datagrams allow the inclusion of optional, varying length fields that need not appear in every datagram. We may sometimes want to send special information, but we don't want to dedicate a field in the packet header for this purpose.  Options start with a 1-byte option code,followed by1-byte option length field, followed by zero or more bytes of option data. The option code byte contains three parts:  copy flag (1 bit):  If 1, replicate option in each fragment of a fragmented datagram. That is, this option should appear in every fragment as well. If 0, option need only appear in first fragment.  option class (2 bits):  Purpose of option:  0 = network control 1 = reserved 2 = debugging and measurement 3 = reserved option number (5 bits):  A code indicating the option's type.  See  Figure 5.46  for these. The IPV4 Protocol
Network Layer In The Internet Class A addresses start with a `0' in the most significant bit, followed by a 7-bit network address and a 24-bit local part.  Class B addresses start with a `10' in the two most significant bits, followed by a 14-bit network number and a 16-bit local part.  Class C addresses start with a `110' in the three most significant bits, followed by a 21-bit network number and an 8-bit local part.  Class D addresses start with a `1110' in the four most significant bits, followed by a 28-bit group number.  Used for multicast. Class E addresses start with a ‘11110’ and are  reserved for future use. IPV4 Addresses Address Classes The Internet designers were unsure whether the world would evolve into a few networks with many hosts (e.g., large networks), or many networks each supporting only a few hosts (e.g., small networks).  Thus, Internet addresses handle both large and small networks.  Internet address are four bytes in size, where:
Network Layer In The Internet IPV4 Addresses
Network Layer In The Internet Address Classes The use of fixed-sized IP addresses makes the routing operation efficient.  In the ISO world, addresses are of varying format and length and extracting the address from the packet may not be straightforward.  Registration of addresses is through the NIC (Network Information Center.) See  Figure 5.48  for the use of special addresses. IPV4 Addresses
Network Layer In The Internet Goals: We want to be able to reduce the number of networks seen by the outside world;  We want to simplify the management of those many networks within the organization; We want to be able to slice the network/node “pie” in various ways. A large organization or campus might have 30 or more LANs (one for each department).  An organization will probably have only a single connection to the rest of the Internet. In order for every local host to be able to communicate with other Internet machines, routing entries for each of the 30 networks must exist in the core gateways.  In order for other sites to be able to respond to our queries, they must be able to route packets back to us.  Wouldn't it be nice if we only needed to advertise a single network number for all 30 networks?  The Answer: Subnet addressing is a technique that allows a set of multiple, interconnected networks to be covered by a single IP network number.  IP addresses have a well-defined structure that allows a gateway to extract the network portion of an address by simply looking at its class and an optional netmask. Subnets This usage of “Subnets” is different from that we used before to define the routers and lines in a network.
Network Layer In The Internet With subnetting, the local part of an IP address is further subdivided into a network and a host part:  Consider two addresses 128.204.2.29 and 128.204.3.109.  Are they on the same network?  NO.   They refer to hosts on the same network address (128.204), but they can actually be on  different  ethernets connected by a bridge.  To do this, we divide the local part (the two bytes to the right of 128.204) into a 1-byte network part and a 1-byte host part.  When sending data to 128.204.3.109 local gateways first route datagrams to the (sub)network 128.204.3 rather than (IP network) 128.204.  128.204.2 and 128.204.3 are distinct (sub)networks.  To the outside world, there is only a single network 128.204.  Each of the individual networks is called a subnet.  Subnets
Network Layer In The Internet With subnetting, the local part of an IP address is further subdivided into a network and a host part:  Consider two addresses 128.204.2.29 and 128.204.3.109.  Are they on the same network?  YES.   They refer to hosts on the same network address (128.204), but they can actually be on  different  Ethernets connected by a bridge.  To do this, we divide the local part (the two bytes to the right of 128.204) into a 7-bit network part and a 9-bit host part. Our example above is a Class B address; the technique applies also to Classes A and C. Subnets
Network Layer In The Internet Subnets
Network Layer In The Internet Subnets
Ad

More Related Content

What's hot (20)

Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
Manoj Kumar
 
Network layer
Network layerNetwork layer
Network layer
Hasib Shaikh
 
Ch4 net layer network
Ch4 net layer networkCh4 net layer network
Ch4 net layer network
cairo university
 
Network Layer
Network LayerNetwork Layer
Network Layer
Rutwik Jadhav
 
Ch 19 Network-layer protocols - section 2
Ch 19   Network-layer protocols - section 2Ch 19   Network-layer protocols - section 2
Ch 19 Network-layer protocols - section 2
Hossam El-Deen Osama
 
Network layer logical addressing
Network layer logical addressingNetwork layer logical addressing
Network layer logical addressing
Sri Manakula Vinayagar Engineering College
 
Unit 4 - Network Layer
Unit 4 - Network LayerUnit 4 - Network Layer
Unit 4 - Network Layer
Chandan Gupta Bhagat
 
Transport layer
Transport layer Transport layer
Transport layer
Mukesh Chinta
 
IP Datagram Structure
IP Datagram StructureIP Datagram Structure
IP Datagram Structure
Hitesh Mohapatra
 
Connection( less & oriented)
Connection( less & oriented)Connection( less & oriented)
Connection( less & oriented)
ymghorpade
 
Internet Protocol Version 4
Internet Protocol Version 4Internet Protocol Version 4
Internet Protocol Version 4
Purushottam Kamble
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
Kathirvel Ayyaswamy
 
Computer Network
Computer NetworkComputer Network
Computer Network
Sweta Kumari Barnwal
 
Ipv4 packet structure
Ipv4 packet structureIpv4 packet structure
Ipv4 packet structure
vlsirajagopal
 
Transport layer (computer networks)
Transport layer (computer networks)Transport layer (computer networks)
Transport layer (computer networks)
Fatbardh Hysa
 
Network Layer
Network LayerNetwork Layer
Network Layer
Ghaffar Khan
 
A day in the life of a Web Request
A day in the life of a Web RequestA day in the life of a Web Request
A day in the life of a Web Request
MD.ANISUR RAHMAN
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
sanjoysanyal
 
Ipv4 header
Ipv4 headerIpv4 header
Ipv4 header
Pouyan Zamani
 
Week9 lec1
Week9 lec1Week9 lec1
Week9 lec1
syedhaiderraza
 

Viewers also liked (20)

tcp_udp [Redes de Computadoras] [Semana 7]
tcp_udp [Redes de Computadoras] [Semana 7]tcp_udp [Redes de Computadoras] [Semana 7]
tcp_udp [Redes de Computadoras] [Semana 7]
Julio Antonio Huaman Chuque
 
Osi model
Osi model Osi model
Osi model
maha tce
 
Osi
OsiOsi
Osi
Reenner Salazar
 
Tcp Udp
Tcp UdpTcp Udp
Tcp Udp
Eri Alam
 
Computer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link LayerComputer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link Layer
Deepak John
 
The OSI Model of Networking
The OSI Model of NetworkingThe OSI Model of Networking
The OSI Model of Networking
Kashif Sohail
 
Osi reference model in Networking
Osi reference model in NetworkingOsi reference model in Networking
Osi reference model in Networking
Satya P. Joshi
 
Osi model in networking
Osi model in networkingOsi model in networking
Osi model in networking
Future Programming
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
Melvin Cabatuan
 
Chapter 3 final
Chapter 3 finalChapter 3 final
Chapter 3 final
ushabarad142
 
MS-06 Jan June 2017
MS-06 Jan June 2017MS-06 Jan June 2017
MS-06 Jan June 2017
Dharmendra Kumar Singh
 
Chapter02 -- networking standards and the osi model
Chapter02  -- networking standards and the osi modelChapter02  -- networking standards and the osi model
Chapter02 -- networking standards and the osi model
Raja Waseem Akhtar
 
Network Layer
Network LayerNetwork Layer
Network Layer
Ghaffar Khan
 
OSI Model - Every Detail Explained
OSI Model - Every Detail ExplainedOSI Model - Every Detail Explained
OSI Model - Every Detail Explained
Ashish Malik
 
OSI MODEL - A PROJECT
OSI MODEL - A PROJECTOSI MODEL - A PROJECT
OSI MODEL - A PROJECT
Abhi shreshtha
 
Osi model
Osi modelOsi model
Osi model
Online
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networks
guesta81d4b
 
Html Ppt
Html PptHtml Ppt
Html Ppt
vijayanit
 
7 layer OSI
7 layer OSI7 layer OSI
7 layer OSI
asepmunandar15
 
Ad

Similar to Internet Protocol (20)

I.p. protocol
I.p. protocolI.p. protocol
I.p. protocol
Jitendra Shishangiya
 
Ip protocol
Ip protocolIp protocol
Ip protocol
H K
 
Ipspk1
Ipspk1Ipspk1
Ipspk1
supriya kurlekar
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
A&U Trading Corporation
 
Ip and icmp
Ip and icmpIp and icmp
Ip and icmp
Programmer
 
network fundamental
network fundamentalnetwork fundamental
network fundamental
Institute of Information Security (IIS)
 
10 coms 525 tcpip - internet protocol - ip
10   coms 525 tcpip -  internet protocol - ip10   coms 525 tcpip -  internet protocol - ip
10 coms 525 tcpip - internet protocol - ip
Palanivel Kuppusamy
 
IP Address
IP AddressIP Address
IP Address
Rahul P
 
As the packet travels through the TCP.docx
As the packet travels through the TCP.docxAs the packet travels through the TCP.docx
As the packet travels through the TCP.docx
laraibshaheen
 
Ipv4 and Ipv6
Ipv4 and Ipv6Ipv4 and Ipv6
Ipv4 and Ipv6
Rishav Bhurtel
 
linux unit 4 (2).pptxjiy8t7r7iguyguyy888
linux unit 4 (2).pptxjiy8t7r7iguyguyy888linux unit 4 (2).pptxjiy8t7r7iguyguyy888
linux unit 4 (2).pptxjiy8t7r7iguyguyy888
abhinandpk2405
 
TCP/IP Protocol Architeture
TCP/IP Protocol ArchitetureTCP/IP Protocol Architeture
TCP/IP Protocol Architeture
Manoj Kumar
 
Custom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_RouterCustom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_Router
Vishal Vasudev
 
07 - TCP_IP and the DoD Model.ppt
07 - TCP_IP and the DoD Model.ppt07 - TCP_IP and the DoD Model.ppt
07 - TCP_IP and the DoD Model.ppt
ssuserf7cd2b
 
Tcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication headerTcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication header
Faizan Shaikh
 
tcpheader-151221111244.pdf
tcpheader-151221111244.pdftcpheader-151221111244.pdf
tcpheader-151221111244.pdf
EnumulaBhargava1
 
IP Address
IP AddressIP Address
IP Address
Sukhdeep Kaur
 
IPv6 - The Next next generation protocol
IPv6 - The Next next generation protocolIPv6 - The Next next generation protocol
IPv6 - The Next next generation protocol
Mohit Sharma
 
Exploration network chapter_5_modified
Exploration network chapter_5_modifiedExploration network chapter_5_modified
Exploration network chapter_5_modified
rajesh531
 
Linux Internals - Interview essentials 2.0
Linux Internals - Interview essentials 2.0Linux Internals - Interview essentials 2.0
Linux Internals - Interview essentials 2.0
Emertxe Information Technologies Pvt Ltd
 
Ip protocol
Ip protocolIp protocol
Ip protocol
H K
 
10 coms 525 tcpip - internet protocol - ip
10   coms 525 tcpip -  internet protocol - ip10   coms 525 tcpip -  internet protocol - ip
10 coms 525 tcpip - internet protocol - ip
Palanivel Kuppusamy
 
IP Address
IP AddressIP Address
IP Address
Rahul P
 
As the packet travels through the TCP.docx
As the packet travels through the TCP.docxAs the packet travels through the TCP.docx
As the packet travels through the TCP.docx
laraibshaheen
 
linux unit 4 (2).pptxjiy8t7r7iguyguyy888
linux unit 4 (2).pptxjiy8t7r7iguyguyy888linux unit 4 (2).pptxjiy8t7r7iguyguyy888
linux unit 4 (2).pptxjiy8t7r7iguyguyy888
abhinandpk2405
 
TCP/IP Protocol Architeture
TCP/IP Protocol ArchitetureTCP/IP Protocol Architeture
TCP/IP Protocol Architeture
Manoj Kumar
 
Custom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_RouterCustom_IP_Network_Protocol_and_Router
Custom_IP_Network_Protocol_and_Router
Vishal Vasudev
 
07 - TCP_IP and the DoD Model.ppt
07 - TCP_IP and the DoD Model.ppt07 - TCP_IP and the DoD Model.ppt
07 - TCP_IP and the DoD Model.ppt
ssuserf7cd2b
 
Tcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication headerTcp header/IP Header/Authentication header
Tcp header/IP Header/Authentication header
Faizan Shaikh
 
tcpheader-151221111244.pdf
tcpheader-151221111244.pdftcpheader-151221111244.pdf
tcpheader-151221111244.pdf
EnumulaBhargava1
 
IPv6 - The Next next generation protocol
IPv6 - The Next next generation protocolIPv6 - The Next next generation protocol
IPv6 - The Next next generation protocol
Mohit Sharma
 
Exploration network chapter_5_modified
Exploration network chapter_5_modifiedExploration network chapter_5_modified
Exploration network chapter_5_modified
rajesh531
 
Ad

More from Ghaffar Khan (20)

World is beautiful ... ...
World is beautiful ... ...World is beautiful ... ...
World is beautiful ... ...
Ghaffar Khan
 
My Presentation On Ajax
My Presentation On AjaxMy Presentation On Ajax
My Presentation On Ajax
Ghaffar Khan
 
Sorting
SortingSorting
Sorting
Ghaffar Khan
 
How A Computer Works
How A Computer WorksHow A Computer Works
How A Computer Works
Ghaffar Khan
 
For Loop
For LoopFor Loop
For Loop
Ghaffar Khan
 
Exponential and Logarthmic funtions
Exponential and Logarthmic funtionsExponential and Logarthmic funtions
Exponential and Logarthmic funtions
Ghaffar Khan
 
Exponential and Logarthmic funtions (1)
Exponential and Logarthmic funtions (1)Exponential and Logarthmic funtions (1)
Exponential and Logarthmic funtions (1)
Ghaffar Khan
 
Functions
FunctionsFunctions
Functions
Ghaffar Khan
 
Quadratic And Polinomial Function
Quadratic And Polinomial FunctionQuadratic And Polinomial Function
Quadratic And Polinomial Function
Ghaffar Khan
 
Quadratic And Polinomial Function
 Quadratic And Polinomial Function Quadratic And Polinomial Function
Quadratic And Polinomial Function
Ghaffar Khan
 
Exponentioal And Logarthmic Functions
 Exponentioal And Logarthmic Functions Exponentioal And Logarthmic Functions
Exponentioal And Logarthmic Functions
Ghaffar Khan
 
Introduction to Computer Networks
 Introduction to Computer Networks Introduction to Computer Networks
Introduction to Computer Networks
Ghaffar Khan
 
Control Structures
Control StructuresControl Structures
Control Structures
Ghaffar Khan
 
Input And Output
 Input And Output Input And Output
Input And Output
Ghaffar Khan
 
Surfaces
SurfacesSurfaces
Surfaces
Ghaffar Khan
 
Vector Tools
Vector ToolsVector Tools
Vector Tools
Ghaffar Khan
 
Drawing Tools
Drawing ToolsDrawing Tools
Drawing Tools
Ghaffar Khan
 
Drawing Figures
Drawing FiguresDrawing Figures
Drawing Figures
Ghaffar Khan
 
Computer Graphics Introduction
Computer Graphics IntroductionComputer Graphics Introduction
Computer Graphics Introduction
Ghaffar Khan
 
3 D Graphics
3 D Graphics3 D Graphics
3 D Graphics
Ghaffar Khan
 
World is beautiful ... ...
World is beautiful ... ...World is beautiful ... ...
World is beautiful ... ...
Ghaffar Khan
 
My Presentation On Ajax
My Presentation On AjaxMy Presentation On Ajax
My Presentation On Ajax
Ghaffar Khan
 
How A Computer Works
How A Computer WorksHow A Computer Works
How A Computer Works
Ghaffar Khan
 
Exponential and Logarthmic funtions
Exponential and Logarthmic funtionsExponential and Logarthmic funtions
Exponential and Logarthmic funtions
Ghaffar Khan
 
Exponential and Logarthmic funtions (1)
Exponential and Logarthmic funtions (1)Exponential and Logarthmic funtions (1)
Exponential and Logarthmic funtions (1)
Ghaffar Khan
 
Quadratic And Polinomial Function
Quadratic And Polinomial FunctionQuadratic And Polinomial Function
Quadratic And Polinomial Function
Ghaffar Khan
 
Quadratic And Polinomial Function
 Quadratic And Polinomial Function Quadratic And Polinomial Function
Quadratic And Polinomial Function
Ghaffar Khan
 
Exponentioal And Logarthmic Functions
 Exponentioal And Logarthmic Functions Exponentioal And Logarthmic Functions
Exponentioal And Logarthmic Functions
Ghaffar Khan
 
Introduction to Computer Networks
 Introduction to Computer Networks Introduction to Computer Networks
Introduction to Computer Networks
Ghaffar Khan
 
Control Structures
Control StructuresControl Structures
Control Structures
Ghaffar Khan
 
Computer Graphics Introduction
Computer Graphics IntroductionComputer Graphics Introduction
Computer Graphics Introduction
Ghaffar Khan
 

Recently uploaded (20)

Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 

Internet Protocol

  • 1. Computer Networks Network Layer In The Internet by Abdul Ghaffar
  • 2. Network Layer In The Internet Overview This section is TCP specific, It’s how the Internet works. Defined by RFC 791. Most Popular Layer 3.
  • 3. Network Layer In The Internet The Internet Protocol (IP) is a network layer protocol. Hosts and gateways process packets called Internet datagrams (IP datagrams). IP provides connectionless, best-effort delivery service to the layers above it. The Transmission Control Protocol (TCP) is a transport layer protocol. Provides reliable stream service between processes on two machines. It uses acknowledgments and retransmissions methods to overcome the unreliability of IP. The Universal Datagram Protocol (UDP) is a Transport Layer Protocol. It provides connectionless datagram service between processes. The IP Protocol
  • 4. Network Layer In The Internet INTERNET PROTOCOL (IP) The goal of IP is to interconnect networks of diverse technologies and create a single, virtual network to which all hosts connect. Hosts communicate with other hosts by handing datagrams to the IP layer; The sender doesn't worry about the details of how the networks are actually interconnected. IP provides unreliable, connectionless delivery service. IP defines a universal packet called an Internet Datagram. The IPV4 Protocol All Internet hosts and gateways process IP datagrams.
  • 5. Network Layer In The Internet 1. Version number (4-bits): The current protocol version is 4. Including a version number allows a future version of IP be used along side the current version, facilitating migration to new protocols. 2. Header length (4-bits): Length of the datagram header (excluding data) in 32-bit words. The minimum length is 5 words = 20 bytes, but can be up to 15 words = 60 bytes, if options are used. In practice, the length field is used to locate the start of the data portion of the datagram. The IPV4 Protocol
  • 6. Network Layer In The Internet 3. Type-of-service (8-bits): (last 2 unused) A hint to the routing algorithms as to what type of service we desire. Precedence (3-bits): A priority indication, where 0 is the lowest and means normal service, while 7 is highest and is intended for network control messages (e.g., routing, congestion control). Delay (1-bit): An Application can request low delay service (e.g., for interactive use). Throughput (1-bit): Application requests high throughput. Reliability (1-bit): Application requests high reliability. The IPV4 Protocol
  • 7. Network Layer In The Internet Note: These last three TOS bits will generally be mutually exclusive. Does setting the low-delay bit guarantee getting such service? No. The type-of-service field is meant as a request or hint to the routing algorithms, but does not guarantee that your request can be honored (e.g., there may not be a low-delay path available). In practice, routers ignore the TOS field in IPV4. The IPV4 Protocol
  • 8. Network Layer In The Internet 4. Total length (16-bits): Total length of the IP datagram (in bytes), including data and header. The size of the data portion of the datagram is the total length minus the size of the header. The IPV4 Protocol
  • 9. Network Layer In The Internet 5 - 8. Identification (16-bits), Flags (3-bits), Fragment offset (13-bits): These three fields are used for fragmentation and reassembly. Gateways along a path are free to fragment datagrams as needed; hosts are required to reassemble fragments before passing complete datagrams to the higher layer protocols. Each fragment contains a complete copy of the original datagram header plus some portion of the data. A receiving host must match arriving fragments with the proper original datagram. These fragments may be out of order and interleaved with other fragments. All fragments of a datagram will have the same source and destination IP address The IPV4 Protocol
  • 10. Network Layer In The Internet 5 - 8. Identification (16-bits), Flags (3-bits), Fragment offset (13-bits) (Continued): The identification field uniquely identifies fragments of the same original datagram. Whenever a host sends a datagram, it sets the identification field of the outgoing datagram and increments its local identification counter. The offset field shows order of the fragments. When a gateway fragments a datagram, it sets the offset field of each fragment to reflect at what data offset with respect to the original datagram the current fragment belongs. Fragmentation occurs in 8-byte chunks, so the offset holds the “chunk number”. Gateways can further fragment fragments! A 400-byte fragment having an offset of 300 chunks could be split into two 200-byte fragments having offsets of 300 and 325 chunks, respectively. The IPV4 Protocol
  • 11. Network Layer In The Internet We need to know when we’ve received all of the fragments. To help with this, the flags field may contain: A Don't Fragment indication (set by host, honored by gateways). (A 1-bit flag.) The More Fragments field indicates that another fragment follows this one. This fragment is not the last fragment of the original datagram. An unfragmented datagram has an offset of 0, and a More Fragment bit of 0. The last fragment of a fragmented datagram contains More Fragment = Clear and the Offset non-zero. Note: The total length field of the IP header refers to the current datagram, not the original. Thus, the More Fragment bit is needed in order for the recipient host to determine when it has all fragments of a datagram. The IPV4 Protocol
  • 12. Network Layer In The Internet 5 - 8. Identification (16-bits), Flags (3-bits), Fragment offset (13-bits) (Continued): Example: Original Frame: IHL = 5, Length = 656, Fragment Offset = 0, More = 0 Fragment 1: IHL = 5, Length = 256, Fragment Offset = 0, More = 1 Fragment 2: IHL = 5, Length = 256, Fragment Offset = 32, More = 1 Fragment 3: IHL = 5, Length = 144, Fragment Offset = 64, More = 0 The IPV4 Protocol
  • 13. Network Layer In The Internet 9. Time-to-live (8-bits): A counter that is decremented by each gateway. If this hop count reach 0, discard the datagram. Originally, the time-to-live field was intended to reflect real time. In practice, it is now a hop count. The time-to-live field squashes looping packets. It also guarantees that packets don't stay in the network for longer than 255 seconds, a property needed by higher layer protocols that reuse sequence numbers. 10. Protocol (8-bits): What type of data the IP datagram carries (e.g., TCP, UDP, etc.). Needed by the receiving IP to know the higher level service that will next handle the data. The IPV4 Protocol
  • 14. Network Layer In The Internet 11. Header Checksum (16-bits): A checksum of the IP header (excluding data). The IP checksum is computed as follows: Treat the data as a stream of 16-bit words Compute the 1's complement sum of the 16-bit words. Take the 1's complement of the computed sum. It has the property that the order in which the 16-bit words are summed is irrelevant. We can place the checksum in a fixed location in the header, set it to zero, compute the checksum, and store its value in the checksum field. On receipt of a datagram, the computed checksum calculated over the received packet should be zero The header must be recalculated at every router since the time_to_live field is decremented. The IPV4 Protocol
  • 15. Network Layer In The Internet 12. Source address (32-bits): Original sender's address. 13. Destination address (32-bits): Datagram's ultimate destination. The IP embedded datagram contains the source of the original sender (not the forwarding gateway) and the destination address of the ultimate destination. The IPV4 Protocol
  • 16. Network Layer In The Internet 14. IP Options IP datagrams allow the inclusion of optional, varying length fields that need not appear in every datagram. We may sometimes want to send special information, but we don't want to dedicate a field in the packet header for this purpose. Options start with a 1-byte option code,followed by1-byte option length field, followed by zero or more bytes of option data. The option code byte contains three parts: copy flag (1 bit): If 1, replicate option in each fragment of a fragmented datagram. That is, this option should appear in every fragment as well. If 0, option need only appear in first fragment. option class (2 bits): Purpose of option: 0 = network control 1 = reserved 2 = debugging and measurement 3 = reserved option number (5 bits): A code indicating the option's type. See Figure 5.46 for these. The IPV4 Protocol
  • 17. Network Layer In The Internet Class A addresses start with a `0' in the most significant bit, followed by a 7-bit network address and a 24-bit local part. Class B addresses start with a `10' in the two most significant bits, followed by a 14-bit network number and a 16-bit local part. Class C addresses start with a `110' in the three most significant bits, followed by a 21-bit network number and an 8-bit local part. Class D addresses start with a `1110' in the four most significant bits, followed by a 28-bit group number. Used for multicast. Class E addresses start with a ‘11110’ and are reserved for future use. IPV4 Addresses Address Classes The Internet designers were unsure whether the world would evolve into a few networks with many hosts (e.g., large networks), or many networks each supporting only a few hosts (e.g., small networks). Thus, Internet addresses handle both large and small networks. Internet address are four bytes in size, where:
  • 18. Network Layer In The Internet IPV4 Addresses
  • 19. Network Layer In The Internet Address Classes The use of fixed-sized IP addresses makes the routing operation efficient. In the ISO world, addresses are of varying format and length and extracting the address from the packet may not be straightforward. Registration of addresses is through the NIC (Network Information Center.) See Figure 5.48 for the use of special addresses. IPV4 Addresses
  • 20. Network Layer In The Internet Goals: We want to be able to reduce the number of networks seen by the outside world; We want to simplify the management of those many networks within the organization; We want to be able to slice the network/node “pie” in various ways. A large organization or campus might have 30 or more LANs (one for each department). An organization will probably have only a single connection to the rest of the Internet. In order for every local host to be able to communicate with other Internet machines, routing entries for each of the 30 networks must exist in the core gateways. In order for other sites to be able to respond to our queries, they must be able to route packets back to us. Wouldn't it be nice if we only needed to advertise a single network number for all 30 networks? The Answer: Subnet addressing is a technique that allows a set of multiple, interconnected networks to be covered by a single IP network number. IP addresses have a well-defined structure that allows a gateway to extract the network portion of an address by simply looking at its class and an optional netmask. Subnets This usage of “Subnets” is different from that we used before to define the routers and lines in a network.
  • 21. Network Layer In The Internet With subnetting, the local part of an IP address is further subdivided into a network and a host part: Consider two addresses 128.204.2.29 and 128.204.3.109. Are they on the same network? NO. They refer to hosts on the same network address (128.204), but they can actually be on different ethernets connected by a bridge. To do this, we divide the local part (the two bytes to the right of 128.204) into a 1-byte network part and a 1-byte host part. When sending data to 128.204.3.109 local gateways first route datagrams to the (sub)network 128.204.3 rather than (IP network) 128.204. 128.204.2 and 128.204.3 are distinct (sub)networks. To the outside world, there is only a single network 128.204. Each of the individual networks is called a subnet. Subnets
  • 22. Network Layer In The Internet With subnetting, the local part of an IP address is further subdivided into a network and a host part: Consider two addresses 128.204.2.29 and 128.204.3.109. Are they on the same network? YES. They refer to hosts on the same network address (128.204), but they can actually be on different Ethernets connected by a bridge. To do this, we divide the local part (the two bytes to the right of 128.204) into a 7-bit network part and a 9-bit host part. Our example above is a Class B address; the technique applies also to Classes A and C. Subnets
  • 23. Network Layer In The Internet Subnets
  • 24. Network Layer In The Internet Subnets