You are on page 1of 44

Study Smart

CCNA by Naeem Abbas


What Is TCP/IP?

• A suite of protocols
• Rules that dictate how packets
of information are sent across
multiple networks
• Addressing
• Error checking
TCP/IP Protocol
• The Transmission Control Protocol/Internet Protocol (TCP/IP) suit
was created by the Department of Defense (DoD).
• The Internet Protocol can be used to communicate across any set
of interconnected networks.
• TCP/IP supports both LAN and WAN communications.
• IP suite includes not only Layer 3 and 4 specifications but also
specifications for common applications like e-mail, remote login,
terminal emulation and file transfer.
• The TCP/IP protocol stack maps closely to the OSI model in the
lower layers.
The DoD & OSI

DoD Model OSI Model


Application
Application Presentation
Session
Host-to-Host Transport
Internet Network
Network Data Link
Access Physical
TCP/IP Protocol Suit at DoD
DoD Model TCP/IP Protocol Suit
Telnet FTP LPD SNMP
Process /
Application TFTP SMTP NFS X Window

Host-to-Host TCP UDP


ICMP BootP ARP RARP
Internet
IP

Network Fast Token


Ethernet FDDI
Access Ethernet Ring
TCP/IP Applications
• Application layer
– File Transfer Protocol (FTP)
– Remote Login (Telnet)
– E-mail (SMTP)
• Transport layer
– Transport Control Protocol (TCP)
– User Datagram Protocol (UDP)
• Network layer
– Internet Protocol (IP)
• Data link & physical layer
– LAN Ethernet, Token Ring, FDDI, etc.
– WAN Serial lines, Frame Relay, X.25, etc.
Internet Layer Overview

Internet
Internet Protocol
Protocol (IP)
(IP)
Application
Internet
Internet Control
Control Message
Message
Transport Protocol
Protocol (ICMP)
(ICMP)

Internet Address
Address Resolution
Resolution
Protocol
Protocol (ARP)
(ARP)
Data-Link
Reverse
Reverse Address
Address
Physical Resolution
Resolution Protocol
Protocol (RARP)
(RARP)

• In the OSI reference model, the network layer corresponds


to the TCP/IP Internet layer.
Internet Protocol

• Provides connectionless,best - effort delivery


routing of datagrams.

• IP is not concerned with the content of the


datagrams.

• It looks for a way to move the datagrams to


their destination.
IP Datagram
Bit
1 0 Bit 15 Bit 16 Bit 31
Version Header Type
(4) Length (4) Total Length (16)
of Service (8)
Flags
Identification (16) (3) Fragment Offset (13)

Time-to-Live (8) Protocol (8) Header Checksum (16) 20


Bytes
Source IP Address (32)

Destination IP Address (32)

Options (0 or 32 if Any)

Data (Varies if Any)


IP Datagram
• Version – Currently used IP version
• Header Length – Datagram header length
• TOS – Level of importance assigned by a particular upper-layer protocol
• Total Length- Length of packet in bytes including Data and Header
• Identification – Identifies current datagram (Sequence Number)
• Flags – Specifies whether the packet can be fragmented or not
• Fragment Offset – Used to piece together datagram fragments
•TTL – It maintains a counter that gradually decreases, in increments, to zero
• Protocol – It indicates which upper-layer protocol receives incoming packets
• Header Checksum – Calculated checksum of the header to check its integrity
• Source IP Address – Sending node IP Address
• Destination IP Address – Receiving node IP Address
• Options – It allows IP to support various options like security
• Data – Upper layer information (maximum 64Kb)
Protocol Field

Transport
TCP UDP
Layer

6 17 Protocol
Numbers
Internet
Layer IP

• Determines destination upper-layer protocol


Address Resolution Protocol (ARP)

• ARP works at Internet Layer of DoD Model


• It is used to resolve MAC address with the help of a
known IP address.
• All resolved MAC addresses are maintained in ARP
cache table is maintained.
• To send a datagram this ARP cache table is checked
and if not found then a broadcast is sent along with
the IP address.
• Machine with that IP address responds and the MAC
address is cached.
Address Resolution Protocol
I need the
Ethernet
address of
176.16.3.2.

172.16.3.1 172.16.3.2

IP:
IP: 172.16.3.2
172.16.3.2 == ???
???
Address Resolution Protocol
I need the
I heard that broadcast.
Ethernet
The message is for me.
address of
Here is my Ethernet
176.16.3.2.
address.

172.16.3.1 172.16.3.2

IP:
IP: 172.16.3.2
172.16.3.2 == ???
???
Address Resolution Protocol
I need the
I heard that broadcast.
Ethernet
The message is for me.
address of
Here is my Ethernet
176.16.3.2.
address.

172.16.3.1 172.16.3.2

IP:
IP: 172.16.3.2
172.16.3.2 == ???
???

IP:
IP: 172.16.3.2
172.16.3.2
Ethernet:
Ethernet: 0800.0020.1111
0800.0020.1111
Address Resolution Protocol
I need the
I heard that broadcast.
Ethernet
The message is for me.
address of
Here is my Ethernet
176.16.3.2.
address.

172.16.3.1 172.16.3.2

IP:
IP: 172.16.3.2
172.16.3.2 == ???
???

IP:
IP: 172.16.3.2
172.16.3.2
Ethernet:
Ethernet: 0800.0020.1111
0800.0020.1111

Map IP Ethernet
RARP (Reverse ARP)
• This also works at Internet Layer.
• It works exactly opposite of ARP
• It resolves an IP address with the help of a known
MAC addres.
• DHCP is the example of an RARP implementation.
• Workstations get their IP address from a RARP
server or DHCP server with the help of RARP.
Reverse ARP

What is
my IP
address?

Ethernet:
Ethernet: 0800.0020.1111
0800.0020.1111 IP
IP == ???
???
Reverse ARP

I heard that
broadcast.
What is
Your IP
my IP
address is
address?
172.16.3.25.

Ethernet:
Ethernet: 0800.0020.1111
0800.0020.1111 IP
IP == ???
???
Reverse ARP

I heard that
broadcast.
What is
Your IP
my IP
address is
address?
172.16.3.25.

Ethernet:
Ethernet: 0800.0020.1111
0800.0020.1111 IP
IP == ???
???

Ethernet:
Ethernet: 0800.0020.1111
0800.0020.1111
IP:
IP: 172.16.3.25
172.16.3.25
Reverse ARP

I heard that
broadcast.
What is
Your IP
my IP
address is
address?
172.16.3.25.

Ethernet:
Ethernet: 0800.0020.1111
0800.0020.1111 IP
IP == ???
???

Ethernet:
Ethernet: 0800.0020.1111
0800.0020.1111
IP:
IP: 172.16.3.25
172.16.3.25

•Map Ethernet IP
Bootstrap Protocol (BootP)

• BootP stands for BootStrap Protocol.


• BootP is used by a diskless machine to learn the
following:
– Its own IP address
– The IP address and host name of a server machine.
– The boot filename of a file that is to be loaded into
memory and executed at boot-up.
• BootP is an old program and is now called the DHCP.
DHCP (Dynamic Host Configuration Protocol)

• The DHCP server dynamically assigns IP address to hosts.


• All types of Hardware can be used as a DHCP server, even a Cisco Router.
• BootP can also send an operating system that a host can boot from. DHCP
can not perform this function.
• Following information is provided by DHCP while host registers for an IP
address:
• IP Address
– Subnet mask
– Domain name
– Default gateway (router)
– DNS
Internet Control Message
Protocol
•ICMP messages are carried in IP datagrams and used to send error
and control messages.

Application

Transport Destination
1 Unreachable
ICMP
Echo (Ping)
Internet
Other
Data-Link

Physical
ICMP Ping
Transport Layer Overview

Transmission
Transmission Control
Control Connection-
Application Protocol
Protocol (TCP)
(TCP) Oriented

Transport User
User Datagram
Datagram Connectionless
Protocol
Protocol (UDP)
(UDP)
Internet

Data-Link

Physical
Transmission Control Protocol (TCP)

• TCP works at Transport Layer

• TCP is a connection oriented protocol.

• TCP is responsible for breaking messages into segments


and reassembling them.

• Supplies a virtual circuit between end-user application.


TCP Segment Format
Bit 0 Bit 15 Bit 16 Bit 31

Source Port (16) Destination Port (16)

Sequence Number (32)

Acknowledgment Number (32) 20


Bytes
Header
Length (4) Reserved (6) Code Bits (6) Window (16)

Checksum (16) Urgent (16)

Options (0 or 32 if Any)

Data (Varies)
TCP Segment Format
• Source port – Number of the calling port
• Destination Port – Number of the called port
• Sequence Number – Number used to ensure correct sequencing of the
arriving data
• Acknowledgement Number – Next expected TCP octet
• Header Length – Length of the TCP header
• Reserved – Set to zero
• Code Bits – Control Functions (setup and termination of a session)
• Window – Number of octets that the sender is willing to accept
• Checksum – Calculated checksum of the header and data fields
• Urgent Pointer – Indication of the end of the urgent data
• Options – One option currently defined (maximum TCP segment size)
• Data – Upper layer protocol data
Port Numbers

F T S D T S R
T E M N F N I
Application P
Layer
P L T S T M
N P P P
E
T

21
21 23 25 53
53 69
69 161 520 Port
Transport Numbers
Layer TCP UDP
TCP Port Numbers

Source
Source Destination
Destination …

Port
Port Port
Port

Telnet Z
Host A Host Z

SP DP Destination port = 23.


1028 23 … Send packet to my
1028 23 …
Telnet
application.
TCP Three-Way Handshake/Open
Connection
Host A Host B

Send SYN
1
(seq = 100 ctl = SYN)
SYN Received

Send SYN, ACK 2


SYN Received (seq = 300 ack = 101
ctl = syn,ack)
Established
3 (seq = 101 ack = 301
ctl = ack)
TCP Simple Acknowledgment
Sender Receiver
Send 1
Receive 1
Send ACK 2
Receive ACK 2

Send 2
Receive 2
Send ACK 3
Receive ACK 3
Send 3
Receive 3

Receive ACK 4 Send ACK 4

• Window Size = 1
TCP Sequence and
Acknowledgment Numbers

Source
Source Destination
Destination Sequence
Sequence Acknowledgment
Acknowledgment …

Port
Port Port
Port

I just
sent number
I just got number
10
10, now I need
number 11.
Source
Source Dest.Seq.
Dest. Seq. Ack.
Ack.

SourceDest. Seq. Ack.


1028
1028 23
23 10
10 11

23
23 1028
1028 11 11
11

1028
1028 23
23 11
11 22 .
TCP Windowing

Window Size = 3
Sender Send 1 Window Size = 3 Receiver
Window Size = 3
Send 2
Window Size = 3
Send 3
ACK 3 Packet 3 Is
Window Size = 2 Dropped
Window Size = 3
Send 3
Window Size = 3
Send 4
ACK 5
Window Size = 2
UDP (User Datagram Protocol)
• A connectionless and unacknowledged protocol.
• UDP is also responsible for transmitting messages.
• But no checking for segment delivery is provided.
• UDP depends on upper layer protocol for reliability.
• TCP and UDP uses Port no. to listen to a particular services.
UDP Segment Format
Bit
1 0 Bit 15 Bit 16 Bit 31

Source Port (16) Destination Port (16)


8
Bytes
Length (16) Checksum (16)

Data (if Any)

• No sequence or acknowledgment fields


UDP Segment Format

• Source port – Number of the calling port


• Destination Port – Number of the called port
• Length – Number of bytes, including header and data
• Checksum – Calculated checksum of the header and data
fields
• Data – Upper layer protocol data
Application Layer Overview
File
File Transfer
Transfer
-- TFTP*
TFTP*
-- FTP*
FTP*
-- NFS
NFS
E-Mail
E-Mail
-- SMTP
SMTP
Remote
Remote LoginLogin
Application
-- Telnet*
Telnet*
-- rlogin*
rlogin*
Transport Network
Network Management
Management
-- SNMP*
SNMP*
Internet Name
Name Management
Management
-- DNS*
DNS*
Data-Link

*Used by the Router


Physical
Telnet

• Telnet is used for Terminal Emulation.


• It allows a user sitting on a remote machine to access the resources of
another machine.

• It allows you to transfer files from one machine to


another.
• It also allows access to both directories and files.
• It uses TCP for data transfer and hence slow but
reliable.
Network File System (NFS)

• It is jewel of protocols specializing in file sharing.


• It allows two different types of file systems to
interoperate.
• This is striped down version of FTP.
• It has no directory browsing abilities.
• It can only send and receive files.
• It uses UDP for data transfer and hence faster but not
reliable.
LPD (Line Printer Daemon)

• The Line Printer Protocol is designed for Printer sharing.

• The LPD along with the LPR (Line Printer Program)


allows print jobs to spooled and sent to the network’s
printers using TCP/IP.

X Window
• X-windows defines a protocol for the writing of
graphical user interface-based client/Server
application.
Simple Network Management Protocol
• SNMP enable a central management of Network.
• Using SNMP an administrator can watch the entire
network.
• SNMP works with TCP/IP.
• IT uses UDP for transportation of the data.
DNS (Domain Name Service)
• DNS resolves FQDNs with IP address.
• DNS allows you to use a domain name to specify and
IP address.
• It maintains a database for IP address and
Hostnames.
• On every query it checks this database and resolves
the IP.

You might also like