Вы находитесь на странице: 1из 44

TN_SP024_E1_1 TCP/IP Protocol and Routing Basics V0610

Course Objectives

TCP/IP protocol stack overview Commonly used equipments Routing principle

TCP/IP Protocol

TCP/IPTransfer Control Protocol/Internet Protocol


Abstract layered model A group of protocols The core function is addressing , route selection (IP protocol at network layer) and transport control (TCP, UDP at transport layer)

TCP/IP Protocol

TCP/IP Protocol model


TCP/IP
Application layer Transport layer Network layer Network Interface layer
IP Token Ring FDDI Ethernet

Internet Protocol stack


FTP

OSI
Application layer

Telnet

SMTP

HTTP

Presentation layer
HTTPS

DNS

SNMP

Session Layer Transport Layer Network layer Data Link Layer Physical Layer

TCP ARP

UDP
RARP

ATM
WLAN

TCP/IP Protocol
Basic conceptlayer Only peer layer can communicate with each other at different system, it means that each layer in sending part can only communicate with corresponding layer at receiving part Same kind of protocols must be used between different entities Data units must be encapsulated and decapsulated when transferred between different layers

TCP/IP Protocol

Basic conceptencapsulation

When information transferred downwards , the software at each layer is responsible to add the head information, this is called encapsulation
Application layer User data User data Application layer

TCP layer

TCP segment

TCP segment

TCP layer

IP layer
Network Interface layer

IP packet bit frame

IP packet

IP layer
Network Interface layer

frame

TCP/IP protocol

Transport layer protocol TCP


Segment upper layer data Establish end to end connection Ensure the reliability of data transfer
32
Ack number

# Bits

16
Source port

16
Dest port

32
Sequence number

4
Header Length

6
Reserved

6
U A P R R C S S G K H T S F Y I N N

16
Window

16
Checksum

16
Urgent

0 or 32
Option Data...

TCP/IP Protocol

Transport layer protocol UDP


Similar function as TCP Simple header format Unreliable data transfer High transfer efficiency

# Bits

16
Source port

16
Destination port

16
Length

16
Checksum Data

TCP/IP Protocol

TCP/IP addressing

Each layer in TCP/IP protocol stack use its own addressing scheme:

Application layer Transport layer Network layer Network interface layer

use host name user port number user IP address use MAC address

TCP/IP Protocol

IPv4 address

In TCP/IP protocol, a unique IP address is assigned to the host to identify them.


In the same subnet, network part of IP address is the same

In different subnet, network part of IP address is different , router must be used to connect them with outside network

TCP/IP Protocol

IP packet header format


0 1 2 3 D 4 T 5 R 6 C 7 Unused Precedence

Bit 0

8 Service Type

16

19

24

31

Version Header len 20 bytes

Total Length Flag Fragment offset

Identification TTL Protocol

fixed
length

Source IP address Destination IP address

length variable

Options Upper layer data ...

Filling in

TCP/IP Protocol

IPv4 address
32 bits

Dotted Decimal
Maximum
1

Network

Host

255
8 9

255
16 17

255
24 25

255
32

Binary

11111111 11111111
128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1

11111111 11111111
128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1

TCP/IP Protocol

IP address classification
Bits: 1 8 9 Host 16 17 16 17 Host 24 25 Host 24 25 32 24 25 Host 32 32 0NNNNNNN Range (1-126) 1 8 9

Class A:
Bits:

Class B:
Bits:

10NNNNNN Network Host Range (128-191) 1 8 9 16 17

Class C:
Bits:

110NNNNN Network Network Host Range (192-223) 1 8 9 16 17 24 25 1110MMMM Multicast Group Range (224-239)

32

Class D:

Multicast Group Multicast Group

TCP/IP Protocol

IP address classification
8 bits 8 bits Host 8 bits Host Host 8 bits Host Host Host

Class A: Class B: Class C: Class D: Class E:

Network

Network Network

Network Network Network

Multicast Research

Addressing Without Subnets

172.19.0.0 A 172.18.0.0

172.16.0.0

172.17.2.0

Subnet: 172.16.0.0 Subnet mask: 255.255.0.0

TCP/IP Protocol

Subnet

In order to solve the problem of IP address shortage and reduce IP address waste, subnet is adopted. Subnet means use several bits of the host part as the subnet address. Such as:
0 0 Network address,7bit Subnet address, 8bit Host address, 16bit 31

In this way, a class A network can be divided into 256 subnets, the IP addresses is efficiently used. Please pay attention, communication between different subnets is the same as communication between different networks, router must be used.

TCP/IP Protocol

Subnet division
172.16.2.200 172.16.3.1 E1 172.16.2.2 E0 172.16.2.1 172.16.3.100 172.16.3.5

172.16.2.160

172.16.3.150

172.16 Network

160

New Routing Table Network Interface 172.16.2.0 E0

Subnet Host

172.16.3.0

E1

Addressing With Subnets

172.16.3.0
A 172.16.4.0

172.16.1.0

172.16.2.0

Subnet mask: 255.255.255.0

TCP/IP Protocol

Subnet Mask

Subnet mask is a 32 bits address which is used to shield part of the IP address to identify network part and host part.

Network
172. 16. 2.160 10101100 00010000

Subnet
00000010 11111111 00000010

Host
10100000 11000000 10000000

255.255.255.192

11111111
10101100

11111111
00010000

TCP/IP Protocol

Subnet mask exercise

Address
172.16.2.10 10.6.24.20 10.30.36.12

Subnet Mask
255.255.255.0 255.255.240.0 255.255.255.0

Class

Subnet

TCP/IP Protocol

Subnet mask exercise answer

Address 172.16.2.10 10.6.24.20 10.30.36.12

Subnet Mask 255.255.255.0 255.255.240.0 255.255.255.0

Class B A A

Subnet 172.16.2.0 10.6.16.0 10.30.36.0

Course Objectives

TCP/IP protocol stack Commonly used equipments Routing principle

Hub: works at physical layer


Signal detected

0101101

0101101

0101101

Send to all the other ports when receiving signal Connect equipments that are in the same segment

PC1

PC2

PC3

Switch : works at data link layer


MAC
MAC1 MAC2

Out 1 2

MAC2 IP DATA

MAC2 IP DATA

Forwarding frames according to MAC address Connect equipments that are in the same segment
1.1.1.3

1.1.1.1

1.1.1.2

MAC1

MAC2

MAC3

Difference between Hub and Switch


100M 10 port HUB
bandwidth100M

100M 10 port Switch


bandwidth>100M*10*2

Slower with more people

No affect with more people

Router: Works at network layer


NET
2.0.0.0 1.0.0.0

Out 2 1
SW2:2.2.2.254 MAC4

SW1:1.1.1.254

forwarding according to destination network address connect equipments that are in different segments
Need to collect routing information (e.g:OSPF, BGP)

MAC3

MAC3 2.2.2.2 data

MAC2 2.2.2.2 data

1.1.1.1

2.2.2.2

G: 1.1.1.254
MAC1

G:2.2.2.254
MAC2

Router Switch
Router
RS
Interface fei_1/1 ip add 1.1.1.254 255.255.255.0

Interface vlan10 ip add 1.1.1.254 255.255.255.0

switch

1.1.1.1/24 G:1.1.1.254

1.1.1.2/24 G:1.1.1.254

1.1.1.1/24 G:1.1.1.254

1.1.1.2/24 G:1.1.1.254

Router switch has both layer two switching and layer three routing function

Comparison between Router and Router-Switch

Router
CPU process packets, Distributed network processor can improve processing capabilities

Router Switch
Switching chip and cpu together architecture
High in port density, cost performance high suitable for inner data exchange of large LAN, routing function is not as strong as router of the same level

Low in port density, expensive suitable for routing between different networks at network egress

Course Objectives

TCP/IP protocol stack Commonly used equipments Routing principle

Route table composition

Example
Mask
255.255.255.0

Dest
172.16.8.0

Gw
1.1.1.1

Interface Owner pri metric


fei_0/1.1 static 1 0

172.16.8.0 255.255.255.0 1.1.1.1 fei_0/1.1 static 1 0

--------

Destination network address Destination network mask Next hop address Route learning interface and forwarding interface how does router learns this entry route priority Metric

Route Types

Directly connected route

Default route

Static route

Dynamic route

Directly connected route


10.0.0.1/24 192.168.0.1/30

A
IPv4 Routing Table: Dest Mask 10.0.0.0 10.0.0.1 192.168.0.0 192.168.0.1 ZXR10#

192.168.0.2/30

B
Interface fei_0/1 fei_0/1 e1_1 e1_1

172.16.0.1/24

Gw 10.0.0.1 10.0.0.1 192.168.0.1 192.168.0.1

Owner

pri

metric 0 0 0 0

255.255.255.0 255.255.255.255 255.255.255.252 255.255.255.255

direct 0 address 0 direct 0 address 0

Directly connected route When network address is configured and the status of the interface is valid, the network configured on this network will appear in the route table and associated with this interfacethe route will change with the status of the interface.

Static route configuration


Stub Network

172.16.1.0

10.0.0.0 Network

SO

172.16.2.2

172.16.2.1

A B

ip route 10.0.0.0 255.0.0.0 172.16.2.2

This is a unidirectional route, there should be an opposite route configured on the counterpart router.

Default route configuration


Example
Stub Network
172.16.1.0
SO

Network

A
172.16.2.2 172.16.2.1

B B

ip route 0.0.0.0 0.0.0.0

172.16.2.2

Default route is configured on the egress router in a stub network.

Dynamic route

OSPF

RIP

OSPF

RIP

1.0.0.0/8

2.0.0.0/8

3.0.0.0/8

Routing protocol is a software process running on the router. It will exchange routing information with other routersstudying route information of network not directly connected and adjusting the route information when topology changes.

Route priority

Select the route that has the highest priority to the route table RIP OSPF

10.0.0.0/16 fei_1/1 10.0.0.0/16 fei_1/3


Notice the comparison of route priority must be between identical routes.

10.0.0.0/16 fei_1/3

Route table

Default route priority

Route Source Connected interface Static route External BGP OSPF IS-IS RIP v1, v2 Internal BGP Special (For inner process)

Default priority 0 1 20 110 115 120 200 255

Longest match principle


ZXR10#show ip route IPv4 Routing Table: Dest Mask 1.0.0.0 1.1.1.1 2.0.0.0 2.1.1.1 3.0.0.0 3.1.1.1 10.0.0.0 10.1.0.0 10.1.1.0 0.0.0.0 255.0.0.0 255.255.255.255 255.0.0.0 255.255.255.255 255.0.0.0 255.255.255.255 255.0.0.0 255.255.0.0 255.255.255.0 0.0.0.0

Gw 1.1.1.1 1.1.1.1 2.1.1.1 2.1.1.1 3.1.1.1 3.1.1.1 1.1.1.1 2.1.1.1 3.1.1.1 1.1.1.1

Interface fei_1/1.1 fei_1/1.1 fei_1/1.2 fei_1/1.2 fei_1/1.3 fei_1/1.3 fei_1/1.1 fei_1/1.2 fei_1/1.3 fei_1/1.1

Owner pri metric direct address direct address direct address ospf static rip static 0 0 0 0 0 0 110 1 120 0 0 0 0 0 0 0 10 0 5 0

10.1.1.1?

Communication in the same network

Network A

To router1
Hub/switch

Communication requirement

Communication process
A B
IP address192.168.1.2 MAC address00:20:AF:00:00:02

Network
IP address192.168.1.1 MAC address00:20:AF:00:00:01 No need to consider higher layer protocols

Protocol layer

IP layer

Encapsulate IP address in packet and send to 192.168.1.2 ARP

decapsulate IP packet Receiving IP packet

IP layer

Ethernet

Encapsulate MAC address in frame and send to MAC address 00:20:AF:00:00:02

Decapsulate MAC frame Receiving MAC frame

Ethernet

Communication between different network

Router DDN Network A PPP

Router
Network B

Ethernet Communication requirements

Ethernet

Communication between different network


Network
PPP Ethernet fei-1/1 HOST A e1_2/1.1 e1_2/1.1 Ethernet fei-1/1 HOST B

Protocol
IP layer

No need to consider higher layer protocols IP packet IP packet

No need to consider higher layer protocols

IP layer

IP IP packet packet

IP layer

IP IP packet packet

IP layer

Ethernet

MAC frame Send host A

Ethernet interface

Serial interface

PPP frame

Serial interface

Ethernet interface

Ethernet

MAC frame Receiving host B

router PPP packet

router

IP communication process

IP communication process basic conception:


IP communication is hop by hop communication Source IP and destination IP address is unchanged Every time the packet passed a data link layer, there will be a new encapsulation of the packet The return path is not related to the forwarding path

Вам также может понравиться