0% found this document useful (0 votes)
34 views

Introduction To TCP/IP

This document provides an overview of TCP/IP including: 1) It describes the TCP/IP protocol stack with layers for application, transport, internet, data link, and physical. 2) It summarizes the transport layer protocols TCP and UDP, and explains how TCP provides reliable connections while UDP is connectionless. 3) It gives an overview of the internet layer including IP, ICMP, ARP, and RARP, explaining how IP packets are routed and how ARP and RARP map IP addresses to MAC addresses.

Uploaded by

Soumik Palit
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Introduction To TCP/IP

This document provides an overview of TCP/IP including: 1) It describes the TCP/IP protocol stack with layers for application, transport, internet, data link, and physical. 2) It summarizes the transport layer protocols TCP and UDP, and explains how TCP provides reliable connections while UDP is connectionless. 3) It gives an overview of the internet layer including IP, ICMP, ARP, and RARP, explaining how IP packets are routed and how ARP and RARP map IP addresses to MAC addresses.

Uploaded by

Soumik Palit
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 45

Introduction to TCP/IP

Host Host

Internet

TCP/IP

Early protocol suite Universal


TCP/IP Protocol Stack

7 Application

6 Presentation 5
Application
5 Session

4 Transport Transport 4

3 Network Internet 3

2 Data Link Data Link 2

1 Physical Physical 1
Application layer Overview

File Transfer
-TFTP*
-FTP*
-NFS

E-mail
-SMTP
Remote login
Application -Telnet*
-rlogin*
Network Management
-SNMP*
Transport Name Management
-DNS*
Internet
* Used by the router
Data Link

Physical
Transport Layer Overview

Application
Transmission Control Connection
Protocol (TCP) Orionted

Transport
User Datagram
Internet Protocol (UDP) Connectionless

Data Link

Physical
TCP Segment Format

Bit 0 Bit 31

Source port (16) Destination port (16)

Source number (32)


20
Acknowledgement number (32) Bytes
Header
Length (4) Reserved (6) Code Bits (6) Window (16)

Checksum (16) Urgent (16)

Options (0 or 32 if any)

Data (Varies)
Port Numbers

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

21 23 25 53 69 161 520 Port


Number
Transport Layer
TCP Port Number
Source Dest.
Port

port

Telnet Z Host A Host Z

… Dest. Port =23.


1028 23 Send packet to my
telnet
Application
Host A Host B

1) Send SYS
(SEQ=100
ctl=SYS)
SYS received

2) Send SYS, ACK


((Seq=300
SYS received ack=101
3) Established ctl=sys,ack
(seq=101 ack=301 ctl=ack)

TCP Three Way


Handalshake/Open Connection
TCP Simple Acknowledgment

Sender

Send 1
Receive 1
Send ACK2
Receive ACK2
Send 2
Receive 2
Send ACK3
Receive ACK3
Send 3
Receive 3
Send ACK4
Receive ACK4
Window size = 1
kTCP Sequence and Acknowledgment Number

Source Port Dest. Port Sequence # Acknowledgement ….


I just Send I just got # 11,
# 11, now I need # 12,

Source Dest. Seq. Ack Source Dest. Seq. Ack


1028 23 10 100 23 1028 v 100 11

Source Dest. Seq. Ack Source Dest. Seq. Ack


1028 23 11 101 23 1028 v 101 12
TCP Windowing

Window size = 3 Window size = 3


Sender send 1 Receiver

Window size = 3
send 2
Window size = 3
send 3 ACK 3 Packet 3 is
Window size = 2 Droppend
Window size = 3
send 3
Window size = 3 ACK 5
send 4 Window size = 2
UDP Segment Format

Bit 0 Bit 15 Bit 16 Bit 16

Source port (16) Destination port (16)

Length port (16) Checksum (16) 20


Bytes

Data (if any)

No sequence or acknowledgment fields


Internet Layer Overview

Application Internet Protocol (IP)


Internet control Message
protocol (ICMP)
Transport Address Resolution
Protocol (ARP)
Reverse Address
Internet Resolution Protocol
(RARP)
Data Link
OSI network layer corresponds to the TCP/IP
Physical
IP Datagram

Bit 0 Bit 15 Bit 16 Bit 31


Version Header Priority & Type
(4) Length (4) Of Service (8) Total Length (16)
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)


Protocol Field

TCP UPP
Transport
Layer

6 17 Protocol
Number
Internet
Layer
IP

Determines destination upper-layer protocol


Protocol Protocol Field

Internet Control Message Protocol (ICMP) 1

Interior Gateway Routing Protocol (IGRP) 9


IP version 6 (IPv6) 41

Generic Routing Encapsulation (GRE) 47

Internetwork packet Exchange in Protocol (IPX in IP) 111


Layer 2 Tunneling Protocol (L2TP) 115
Internet Control Message
Protocol

Application
Destination
1
Unreachable
Transport
Echo (ping)
Internet Other
Data Link

Physical
Address Resolution Protocol

I heard that
I need the broadcast the
Ethernet message is for
address of me. Here is my
176.16.3.2 Ethernet Address.

172.16.3.1 172.16.3.2

IP: 172.16.3.2 = ???

IP: 172.16.3.2
Ethernet: 0800.0020.1111
Map IP MAC
Local ARP
Reverse ARP

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

Ethernet: 0800.0020.1111IP
= ???

IP: 172.16.3.25
Ethernet: 0800.0020.1111
Map MAC IP
Introduction to TCP/IP
Address

172.16.0.1
172.18.0.1

172.18.0.2 172.16.0.2

HDR SA DA DATA
192.168.1.0
10.13.0.0

172.17.0.1 172.17.0.2 192.168.1.1

Unique addressing allows communication between end stations path choice is


based destination address
IP Addressing

Dotted
Network Host
Decimal
Maximum 255 255 255 255

Binary 11111111 11111111 11111111 11111111


1

1
1
2

2
2

32
128

32

128

32

128

32

128
16
8
4

16
8
4

16
8
4
16
8
4
64

64

64
64
Example
172 16 122 204
Decimal
Example 10101100 00010000 01111010 11001100
Binary
IP Address Classes

8 bits 8 bits 8 bits 8 bits


Class A: Network Host Host Host

Class B: Network Network Host Host

Class C: Network Network Network Host


Class D: Multicast
Class E: Research
IP Address Classes

1 8 9 16 17 24 25 32
Bits:
0NNNNNNN Host Host Host
Class A: Range (1-126)

Bits: 1 8 9 16 17 24 25 32
10NNNNNN Network Host Host
Class B:
Range (128-191)

Bits: 1 8 9 16 17 24 25 32
Class C: 110NNNNNN Network Network Host
Range (192-223)

Bits: 1 8 9 16 17 24 25 32
1110NNNNN Multicast group Multicast group Multicast group
Class D:
Range (224-239)
Host Addresses

10.6.24.2 10.1.1.1
172.16.2.2

172.16.3.10 192.16.2.1 10.2508.11

10.180.30.118
172.16.12.12

Routing Table
Network Interface

172.16 12 . 12 172.16.0.0 E0
10.0.0.0 E1
Network Host
Determining Available Host
Addresses

Network Host

172 16 0 0

15
16

14
13
12
11
10

8
7
6
5
4
3
2
1
9
00000000 00000000
00000000 00000001
00000000 00000011 1


2
11111111 11111101 3


11111111 11111110
11111111 11111111
65534
65535
65536
- 2

65534
2N-2 = 216-2 =65534
IP Address Classes Exercise

Address Class Network Host

10.2.1.1
128.63.2.100
201.222.5.64
192.6.141.2.
130.113.64.16
256.241.201.10
Addressing Without Subnets

172.16.0.1 172.16.0.2 172.16.0.3 172.16.255.253 172.16.255.253

……
172.16.0.0

Network 172.16.0.0
Addressing with Subnet

172.16.0.3

172.16.0.4

172.16.0.1 172.16.0.2

Network 172.16.0.0
Subnet Addressing

172.16.3.1 172.16.3.5
172.16.2.200

E1

172.16.2.2 EO 172.16.3.100
172.16.2.1

172.16.3.150
172.16.2.160

Routing Table
Network Interface

172.16 2 160 172.16.2.0 E0


172.16.3.0 E1
Network Subnet Host
Subnet Mask

Network Host
IP
Address 172 16 0 0

0
Default Network Host
Subnet 255 255 0 Host
Mask Also Written as “/16” where 16 represent the number of 1 s in the
mask. 0
8-bit Network Subnet
Subnet 255 255 255
Mask Also Written as”/24” where 24 represent the number of 1 s
in the mask,
Decimal Equivalents of bit patterns

128 64 32 16 8 4 2 1

0 0 0 0 0 0 0 0 = 0
1 0 0 0 0 0 0 0 = 128
1 1 0 0 0 0 0 0 = 192
1 1 1 0 0 0 0 0 = 224
1 1 1 1 0 0 0 0 = 240
1 1 1 1 1 0 0 0 = 248
1 1 1 1 1 1 0 0 = 252
1 1 1 1 1 1 1 0 = 254
1 1 1 1 1 1 1 1 = 255
Subnet Mask Without Subnets

Network Host

172.16.2.160 10101100 00010000 0000010 10100000

255.255.0.0 11111111 11111111 0000000 0000000

10101100 00010000 0000000 0000000

Network 172 16 0 0
Number
Subnets not in use-the default
Subnet Mask With Subnets

Network Subnet Host

172.16.2.160 10101100 00010000 0000010 10100000

255.255.0.0 11111111 11111111 0000000 0000000

10101100 00010000 0000010 0000000

128

248
252
254
192
224
240

255
0
Network
Number 172 16 2

Network number extended by eight bits


Subnet Mask With Subnet
(Cont.)

Network Subnet

172.16.2.160 10101100 00010000 0000010 10100000

255.255.255.192 11111111 11111111 11111111 1100000

10101100 00010000 0000010 0000000

128

248
252
254

224
240
248
192
224
240

255

128
192

252
254
255
Network
Number 172 16 2 128

Network number extended by ten bits


Subnet Mask Exercise

Address Subnet Mask Class Subnet

172.16.2.10 255.255.255.0

10.6.24.20 255.255.240.0

10.30.36.12 255.255.255.0
Broadcast addresses

172.16.0.3

172.16.0.4

172.16.0.1 172.16.0.2

172.16.1.0
(Directed broadcast)

255.255.255.255
(Local network broadcast)

172.16.255.255
(All Subnet broadcast)
Addressing Summary
Example

172 16 2 160

3
172.16.2.160 10101100 00010000 00000010 10100000 Host
255.255.255.192 Mask
11111111 11111111 11111111 11000000
9 8
172.16.2.128 10101100 00010000 00000010 10000000 Subnet

172.16.2.191 10101100 00010000 00000010 10111111 Broadcast

172.16.2.129 10101100 00010000 00000010 10000001 First


172.16.2.190 10101100 00010000 00000010 10111110 Last
Class B Subnet Example

IP Host Address : 172.16.2.121


Subnet Mask : 255.255.255.0

Network Network Subnet Host


172.16.2.121 : 10101100 00010000 00000010 01111001

255.255.255.0: 11111111 11111111 11111111 00000000


Subnet : 10101100 00010000 00000010 00000000
Broadcast : 10101100 00010000 00000010 11111111

Subnet Address = 172.16.2.0

Host
Address = 172.16.2.1 – 172 16.2.254
Broadcast Address = 172.16.2.255
No. Bits Subnet mask No.Subnets No.Hosts
1 255.255.192.0 2 16,382
2 255.255.224.0 6 8190
3 255.255.240.0 14 4049
4 255.255.248.0 30 2046

5 255.255.252.0 62 1022

6 255.255.254.0 126 510


7 255.255.255.0 254 254
8 255.255.255.128 510 126
9 255.255.255.192 1022 62
10 255.255.255.224 2046 30
11 255.255.255.240 4049 14
12 255.255.255.248 8190 6
13 255.255.255.252 16,382 2
20 Subnets
Subnet Planning
5 host per
subnet Class
c address :
192.168.8.0

Other
192.168.5.16
Subnets

192.168.5.32 192.168.5.48
Class C Subnet Planning
Example

IP Host Address : 192.168.5.121


Subnet Mask :
255.255.255.248
Network Network Subnet
192.168.5.121 : 11000000 10101000 00000101 01111001

255.255.255.248: 11111111 11111111 11111111 11111000


Subnet : 11000000 10101000 00000101 01111001
Broadcast : 11000000 10101000 00000101 01111111

Subnet Address = 192.168.5.120

Host
Address = 192.168.5.121 – 192.168.5.126
Broadcast Address = 192.168.5.127
Eight bits of subnetting
No. Bits Subnet mask No.Subnets No.Hosts
1 255.255.255.192 2 62
2 255.255.255.224 6 30
3 255.255.255.240 14 14
4 255.255.255.248 30 6
5 255.255.255.252 62 2
Broadcast Addresses Exercise

Address Subnet Mask Class Subnet Broadcast

201.222.10.60 255.255.255.248

15.16.193.6 255.255.248.0

128.16.32.13 255.255.255.252

153.50.6.27 255.255.255.128
Router Name Sever
Configuration

DNS SERVER
VLAN to VLAN
Overview

Fao/0 Router on
a stick
ISL

VLAN 1 VLAN 2
Application

TCP

IP
10.1.1.2 10.2.2.2
ISL
Network layer device combine multiple
Ethernet
broadcast domains

You might also like