Internet Protocol
Overview
TCP/IP and the DoD Model
IP Addressing
Subnetting
TCP/IP and the DoD Model
Comparison of Dod and OSI Model
The TCP/IP protocol suite
The Process / Application layer Protocols
The Host-to-Host Layer Protocols
The Internet Layer Protocols
Comparison of DoD and OSI Model (1)
The TCP/IP suite was created by the DoD
The DoD model is a condensed version of the OSI model
Application
Presentation
Session
Transport
Network
Data Link
Physical
Process /
Application
Host-to-Host
Internet
Network
Access
DoD Model OSI Model
• Node-to-node application
communication
• Controls user-interface
specifications
• Setting up the level of
transmission service for
applications
• Takes care IP address and
designate protocols for logical
transmission of packets over the
entire network
• Oversees hardware addressing
and defines protocols for the
physical transmission of data
Comparison of DoD and OSI Model (2)
TCP/IP Model OSI Model
The TCP/IP Protocol Suite
Process /
Application Telnet
TCP UDP
IP
ICMP
ARP
LAN Technologies:
Ethernet, Fast Ethernet,
Token Ring, FDDI
WAN Technologies:
Serial Lines, Frame Relay,
ATM
RARP
Host-to-Host
Internet
Network Access
FTP
TFTP SMTP
LPD SNMP
NFS X Window
BootP/
DHCP
DNS
IGMP
The Process / Application Layer Protocols
Telnet – Telephone Network
FTP – File Transfer Protocol
TFTP – Trivial File Transfer Protocol
NFS – Network File System
SMTP – Simple Mail Transfer Protocol
LPD – Line Printer Daemon
X Window – writing a GUI-based client/server applications
DNS – Domain Name Service (DNS)
BootP – Bootstrap Protocol
DHCP – Dynamic Host Configuration Protocol
The Host-to-Host Layer Protocols
To shield the upper-layer applications from the complexities of
the network
TCP (Transmission Control Protocol)
Break down data from upper layers into Segment
Numbers and sequences each segment
Connection-oriented – virtual circuit required
User Datagram Protocol (UDP)
Break down data but not sequence the segment
Thin protocol which doesn’t take up much bandwidth on a network
Connectionless – no virtual circuit required, thus unreliable
For sending little message and reliability accomplished at the
upper layers
Transmission Control Protocol (TCP)
Connection-oriented
Session is established before exchanging data
Virtual circuit required
Reliable Delivery
Sequence numbers
Acknowledgments (ACKs)
Doesn’t trust the lower layers and runs its own CRC
Uses Port Numbers as Endpoints to Communicate
TCP Three-Way Handshake
Application
Transport
Internet
Network
Data
Application
Transport
Internet
Network
Data, ACK
(+start byte)
ACK
TCP Segment Format
User Datagram Protocol (UDP)
Connectionless
No session is established
Does Not Guarantee Delivery
No sequence numbers
No acknowledgments
Low overhead
Reliability Is the Responsibility of the Application
Doesn’t trust the lower layers and runs its own CRC
Uses Port Numbers as Endpoints to Communicate
UDP Segment Format
Low overhead
No sequence number
No Acknowledgement number
No windows size
Transport
Application
Internet
Network
Ports Numbers (1)
TCP and UDP must use port numbers to communicate with the
upper layers.
Port numbers keep track of different conversations crossing
the network simultaneously.
TFTP
Server
Web
Server
0 . . . 65535 0 . . . 65535
TCP Ports
20,21
UDP Port
69
TCP Port
80
Windows Sockets Interface
TCP
Protocol No. 6
UDP
Protocol No. 17
IP
FTP
Server SMTP
TCP Port
25
DNS
UDP Port
53
POP3
UDP Port
110
SNMP
UDP Port
161
Port Numbers (2)
No. below 1024
Well-known port no. defined in RFC 1700
Usually in destination port to tell the receiving host the
purpose of the intended connection
No. 1024 and above
used by upper layers (randomly chosen) to set up
sessions with other hosts
Used by TCP to use as source and destination
addresses in the TCP segment
Usually in Source port to differentiate between sessions
with different source hosts
The Internet Layer Protocols
For routing and providing a single network interface to
the upper layer layers.
All network paths through the model go through IP.
Protocols works at the Internet Layer:
Internet Protocol (IP) – essentially is the Internet
Layer, and other protocols found here merely exist to
support it.
Internet Control Message Protocol (ICMP)
Address Resolution Protocol (ARP)
Reverse Address Resolution Protocol (RARP)
Internet Protocol (IP)
Addresses and Routes Packets according to the
Routing Table
Fragments and Reassembles Datagrams / Packets
Connectionless
No session is established
Nonguaranteed “Best Effort” Delivery
Reliability Is the Responsibility of Higher-Layer
Protocols and Applications
IP header
* Protocol number: 01 – ICMP, 06 – TCP, 17 – UDP, etc.
Internet Control Message Protocol (ICMP)
Management Protocol and messaging service provider
for IP.
In router solicitation, ICMP is used to send the
following events and messages (in the Data area):
Destination Unreachable
Buffer Full
Hops
Ping
Traceroute
Address Resolution Protocol (ARP)
Successful Mapping of an IP Address to a Hardware
Address
ARP Uses a Local Broadcast to Obtain a Hardware
Address
Address Mappings Are Stored in a Cache for Future
Reference
Resolving a local IP Address
ARP Cache
08004. . .
ARP Cache
08004. . .
44
IP Address =
Hardware Address = 08004. . .
IP Address =
Hardware Address = 08007. . .
33
Hardware Address = 08007. . .
22
11
ping
ARP
Broadcast
Resolving a Remote IP Address
A Router B
IP Address =
Hardware Address = 08004.
. .
IP Address =
Hardware Address = 08009.
. .
ARP Cache
08009. . .
08006. . .
ARP Cache
08004. .
.
44
11
08005...
08006...
22
55
ping
ARP
Cache
33
Network 1 Network 2
3
2
1
ARP
Broadcast for
Router
Interface A
ARP
Broadcast for
Router
Interface B
A B
4
5
Reverse Address Resolution Protocol (RARP)
To discover the identity of the IP address for diskless
machines with a RARP broadcast
For diskless workstation asking for its IP address
IP Addressing
IP Terminology
The Hierarchical IP Addressing Scheme
Network Addressing
Address Class Summary
Network addresses: Special Purpose and Guidelines
Assigning Network Addresses
Assigning Host Addresses
IP Addressing was designed to allow a host on
one network to communicate with a host on a
different network, regardless of the type of
LANs the host are participating in.
IP Terminology
Bit / Byte
Octet
Network Address / Subnet Address / Host Address
Broadcast Address
Sending information to all nodes on a network
local / limited broadcast– – all networks, all
nodes
Directed broadcast – all the bits of host address turned on – all
subnets and hosts on network
Broadcast domain – a group of devices receiving broadcast
frames initiating from any device within the group. Because they
do not forward broadcast frames, broadcast domains are
generally surrounded by routers.
The Hierarchical IP Addressing Scheme
Network ID Host ID
32 Bits
w. x. y. z.
:
Class B
The IP address is a structure or hierarchical address which
consists of a 32-bit binary number of 4 octets and is usually
displayed in the decimal format (dotted decimal
notation).
Network Addressing
*The class of the Network is determined by the high order bits
*Class D is for Multicast and Class E is reserved for Research.
Class C
Class A
Network
Address
Host
Address
0
Class B
Network
Address
Host
Address
1 0
Network
Address
Host
Address
1 1 0
0000 00000000 0000
0000 0001 0000 0001 11
....
0111 11100111 1110 126126
0111 11110111 1111 127127
1000 0000 1000 0000 128128
1011 1111 1011 1111 191191
1100 0000 1100 0000 192192
1101 1111 1101 1111 223223
Address Class Summary
Number
of Networks
126
16,384
2,097,152
Number of Hosts
per Network
16,777,214
65,534
254
Class A
Class B
Class C
Range of
Network IDs
(First Octet)
1 – 126
128 – 191
192 – 223
Network Addresses: Special Purpose and
Guidelines
Network Address Cannot Be 127
127 is reserved for loopback functions and self-diagnostic
is reserved as a loopback address
Network ID and/or Host ID Cannot Be All Bits Set to 1
All 1s means “All networks”, or “all nodes”
255 is a broadcast address; a message sent to this address is
broadcast to each machine on the subnet.
– send to “all nodes” on network
Limited Broadcast
Network ID and/or Host ID Cannot Be All Bits Set to 0
- used by Cisco routers to designate the default route
0 means “this network or segment”, or “this node”
Host ID Must Be Unique to the Network
Assigning Network Addresses
Router
1 2 3
Router
Assigning Host Addresses
Router Router
1 2 3
Subnetting
What is a Subnet?
Why Subnetting?
Implementing Subnetting
Subnet Masks
Default Subnet Masks
Possible Subnet Masks for Class A, B & C
Defining a Subnet Mask
Defining a Subnet IDs
Defining a Host Ids
Example
What is a Subnet? (1)
Subnet 1Subnet 1
Subnet 2Subnet 2
Main Network
A subnet is a subsection of an
network, defined for administrative
purpose or to cut down on
broadcast traffic, as all messages
on a network are “heard” by all
hosts whether the message is for
that host or not.
Message sent from one host to
another within the same subnet
do not need to be routed, but
messages sent between hosts in
different subnets must be routed.
Subnets are connected by
routers, or default gateways.
What is a Subnet? (2)
Network ID Host ID
1 0
Example
Network ID FROM ISP No. of Network = 1
SUBNET MASK No. of Hosts = 65534 (2^16-2)
Network ID Host ID
1 0
We need more networks
Subnet ID
Borrow from Host ID
What is a Subnet? (3)
After Subnet
Network ID become -
Subnet mask become
No. of Subnets 254
Host for per Subnet 254 (2^8-2)
Network ID Host ID
1 0
Subnet ID
Use all 8 bit 11111111
for Subnet
254 combinations
(2^8-2)*
Only 8 bit for Host
* However, according to RFC 1812, 255 combinations can be achieved.
What is a Subnet? (4)
After Subnet
Network ID Subnet Mask Host Range
…………
………….
TOTAL 254 SUBNETS
254 HOSTS PER SUBNET
Why Subnetting?
Reduced network traffic –
smaller the network smaller the broadcast domains
and less network traffic on that network segment
Optimized network performance –
result of reduced network traffic
Simplified management –
easier to identify and isolate network problems in a
smaller group
Facilitated spanning of large geographical distances –
since WAN links are considerably slower and more
expensive; connecting multiple smaller networks
makes the system more efficient
Implementing Subnetting
Determine the Number of Required Network IDs
One for each subnet
One for each wide-area network connection
Determine the Number of Required Host IDs per Subnet
One for each TCP/IP host
One for each router interface
Based on the above requirement, create the following:
Define One Subnet Mask Based on Requirements
Define a Unique Subnet ID for Each Physical Segment Based
on the Subnet Mask
Define Valid Host IDs for Each Subnet Based on the Subnet ID
Subnet Masks
A 32-bit value composed of 1s and 0s. The 1s in the
subnet mask represent the positions that refer to the
network or subnet addresses.
Distinguishes the Network ID from the Host ID
Used to Specify Whether the Destination Host is
Local or Remote
If ANDed results of source and destination hosts
match, the destination is local
Default Subnet Masks
Bits Used for Subnet MaskAddressClass Dotted DecimalNotation
Class A
Class B
Class C
11111111 00000000 00000000 00000000
11111111 11111111 00000000 00000000
11111111 11111111 11111111 00000000
.
.
.
.
IP Address
Subnet Mask
Network ID
Host ID
Possible Subnet Masks for Class A, B & C
Class C
Class B
Class A
Defining a Subnet Mask
Convert the Number of Segments to Binary
Count the Number of Required Bits
Convert the Required Number of Bits to Decimal
(High Order)
1
2
3
Example of Class B Address
Number of Subnets
Binary Value
Convert to Decimal
6
0 0 0 0 0 1 1 0
= 6
(3 Bits)
4+2
255 . 255 . 224 . 0
11111111 11111111 11100000 00000000
Subnet Mask
Defining Subnet IDs
255 255 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
00000000 = 0
00100000 = 32
01000000 = 64
01100000 = 96
10000000 = 128
10100000 = 160
11000000 = 192
11100000 = 224
1
2 3
224
Subnet Mask
Defining Host IDs
Subnet IDs Host ID Range
Invalid
–
–
–
–
–
–
Invalid
00000000 = 0
00100000 = 32
01000000 = 64
01100000 = 96
10000000 = 128
10100000 = 160
11000000 = 192
11100000 = 224
Each Subnet ID Indicates the Beginning Value in a Range
The Ending Value Is One Less Than the Beginning Value of the
Next Subnet ID
Example
Subnet Ids Subnet Mask Network ID Host Range
00000000 = 0
00100000 = 32
01000000 = 64
01100000 = 96
10000000 = 128
10100000 = 160
11000000 = 192
11100000 = 224
TOTAL 6 SUBNETS 8190 HOSTS PER SUBNET
Netword ID FROM ISP No. of Network = 1
SUBNET MASK No. of Hosts = 65534 (2^16-2)
We need 6 Subnets255 255 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
224