Академический Документы
Профессиональный Документы
Культура Документы
Course Objectives
TCP/IP 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
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
IP layer
Network Interface layer
frame
TCP/IP protocol
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
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:
use host name user port number user IP address use MAC address
TCP/IP Protocol
IPv4 address
In different subnet, network part of IP address is different , router must be used to connect them with outside network
TCP/IP Protocol
Bit 0
8 Service Type
16
19
24
31
fixed
length
length variable
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:
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:
TCP/IP Protocol
IP address classification
8 bits 8 bits Host 8 bits Host Host 8 bits Host Host Host
Network
Network Network
Multicast Research
172.19.0.0 A 172.18.0.0
172.16.0.0
172.17.2.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
Subnet Host
172.16.3.0
E1
172.16.3.0
A 172.16.4.0
172.16.1.0
172.16.2.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
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
Class B A A
Course Objectives
0101101
0101101
0101101
Send to all the other ports when receiving signal Connect equipments that are in the same segment
PC1
PC2
PC3
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
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
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
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
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
Example
Mask
255.255.255.0
Dest
172.16.8.0
Gw
1.1.1.1
--------
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
Default route
Static route
Dynamic route
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
Owner
pri
metric 0 0 0 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.
172.16.1.0
10.0.0.0 Network
SO
172.16.2.2
172.16.2.1
A B
This is a unidirectional route, there should be an opposite route configured on the counterpart router.
Network
A
172.16.2.2 172.16.2.1
B B
172.16.2.2
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/3
Route table
Route Source Connected interface Static route External BGP OSPF IS-IS RIP v1, v2 Internal BGP Special (For inner process)
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?
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
IP layer
Ethernet
Ethernet
Router
Network B
Ethernet
Protocol
IP layer
IP layer
IP IP packet packet
IP layer
IP IP packet packet
IP layer
Ethernet
Ethernet interface
Serial interface
PPP frame
Serial interface
Ethernet interface
Ethernet
router
IP communication process
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