Você está na página 1de 37

TCP/IP Basis

www.huawei.com

T
HUAWEI TECHNOLOGIES CO., LTD. All rights reserved

The communication is realized via TCP/IP protocol stack between The computers with different model, different manufacturer and different OS. This course will introduce the architecture of TCP/IP protocol stack, the function of each layer and data encapsulation.

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 2

Upon completion of this course, you will be able to : Know architecture of OSI RM Master architecture TCP/IP and the function of each layer Understand the process of TCP/IP data encapsulation

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 3

Chapter 1 TCP/IP Protocol Stack Chapter 2 Data Encapsulation of TCP/IP Protocol Stack

Chapter 3 Case analysis

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 4

OSI Reference Model


OSI RM: Open System Interconnection Reference Model OSI RM has the following advantages

To predigest pertinent network operation To provide compatibility and standard interface between devices To accelerate standardization working Structure is separable Easy to realize and maintenance

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 5

OSI Reference Model


Application layer Presentation layer Session layer Transport layer Network layer Data link layer Physical layer

7 6 5 4 3 2 1

High Layers: In charge of data transmission between hosts.

Low Layers: In charge of data transmission in network.

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 6

Functions of the Seven Layers


7 6 5

Application layer Presentation layer Session layer Transport layer Network layer Data link layer Physical layer

Provide communications between applications Deal with data format problems Establish, maintain and manage sessions Establish, maintain and manage end to end connection Addressing and routing Provide link medium access and link management Bit flow transmission

4
3 2 1

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 7

TCP/IP model
OSI 7 6 Application layer Presentation layer Session layer Transport layer Network layer Data link layer Physical layer Transport layer Network layer Data link layer Physical layer 4 3 2 1 TCP/IP

VS

Application layer

5
4 3 2

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 8

TCP/IP Protocol Stack

Application layer

HTTP, Telnet, FTP TFTP, Ping

Provide application program network interfaces

Transport layer Network layer Data link layer Physical layer

TCP/UDP IP Ethernet, 802.3, PPP Interfaces, wires

Establish terminal to terminal connection Addressing and route selecting


Physical media access

Binary data flow transmission

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 9

Communication between Layers of TCP/IP Model and Data Encapsulation


Host A
Upper layer data

PDU
Application layer Transport layer Segment

TCP header

Upper layer data Upper layer data Upper layer FCS data

IP header

Network layer

Packet

LLC header

Data link layer


MAC header
Upper layer FCS data

Frame

0101110101001000010

Physical layer

Bit

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 10

Data De-encapsulation

Host B Application layer Transport layer Network layer Data link layer Physical layer

Upper layer data Upper layer data TCP+ upper layer data IP+TCP+ upper layer data LLC header+ IP+TCP+ upper layer data 0101110101001000010

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 11

The Function of Physical Layer


Define medium type, interface type, sign type

criterion of requirement for electric, engine, flow and function


when physical link is activation, maintenance and shutdown between the terminal system.

Criterion of character such as voltages, data rate, maximum

transmission distance and physical connector.


LAN Physical (Bits, signals, clocking)
8 0 2 . 3
8 0 2 . 4 8 0 2 . 5 F D D I V.24

WAN

V.35

G.703 EIA/TIA-232

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 12

Physical layer medium and device


Physical layer medium

Coaxial cable
Twisted-pair Fiber Wireless radio
Physical layer device

Repeaters, HUB

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 13

The Function of Data Link Layer


MAC Sub-layer : Media Access Control Sub-Layer

Appoint that how to transmit data packet via physical line and communicate with physical layer
LLC Sub-layer: Logic Link Control Sub-layer

Distinguish protocol types, encapsulate the data and transmit via network Application layer Transport layer Network layer Data link layer Physical layer LLC sub-layer MAC sub-layer

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 14

Protocols of Data Link Layer


Data link layer LAN, WAN protocol

LAN Data Link (Frames) Physical (Bits, signals, clocking)


8 0 2 . 3 802.2 LLC Dial on Demand F D D I

WAN

SDLC

HDLC

Frame Relay

PPP

8 0 2 . 4

8 0 2 . 5

V.24

V.35

G.703 EIA/TIA-232

Data link layer device

Ethernet switch

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 15

Data Link Layer Address


MAC address is composed of 48 bits. The vendor ID of Huawei

products is 0x00e0fc.
24 bits 24 bits

Vender Code Serial Number


00e0.fc01.2345 00e0.fc01.2345

Rom
Ram

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 16

The Function and Device of Network Layer


Function

Data forwarding in the different networkDevice


Router, layer 3 swtich

D Host A

Host B

A
B Router A Router B Network layer Data link layer Physical layer All rights reserved E Router C Network layer Data link layer Physical layer Page 17 Application layer Transport layer Network layer Data link layer Physical layer

Network layer Data link layer Physical layer

HUAWEI TECHNOLOGIES CO., LTD..

Protocols of Network Layer


Protocols of Network layer

Network (Packets)

IP/ICMP/ARP/RARP

802.2 LLC

Data Link (Frames) Physical (Bits, signals, clocking)


8 0 2 . 3 8 0 2 . 4 8 0 2 . 5 F D D I

Dial on Demand

SDLC

HDLC

Frame Relay

PPP

V.24 V.35 G.703 EIA/TIA-232

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 18

Network Address
Network address identifies a device in the network layer

uniquely
Network address include two parts

Network ID
Host ID

Network ID IP Address 10.

Host ID 8.2.48

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 19

The Function of Transport Layer


Segment upper layer data

Set up end to end connection

Transmit data from end to end

ensure the reliability of the data

transmission

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 20

Protocols of Transport Layer


Transport (Segments)
TCP UDP

Network (Packets)

IP

802.2 LLC

Data Link (Frames)


Physical (Bits, signals, clocking)
8 0 2 . 3
8 0 2 . 4 8 0 2 . 5 F D D I

Dial on Demand

SDLC

HDLC

Frame Relay

PPP

V.24 V.35 G.703 EIA/TIA-232

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 21

Main Protocols of Transport Layer


TCP
Connection-oriented
Reliable Suit the application with high reliability

UDP
Connectionless Trustless Suit the application that concerns transmission efficiency Reliability depends on application

High cost

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 22

The Function of Application Layer

Provide user interfaces and deal with specify applications

Provide data encryption, decryption, compression and decompression.

Specify the standards of data presentation.

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 23

Protocols of Application Layer


Application (Data) Transport (Segments) Network (Packets)
802.2 LLC 8 0 2 . 3 8 0 2 . 4 8 0 2 . 5

FTP TELNET HTTP SMTP/POP3 DNS

TFTP SNMP RIP DNS Radius

TCP

UDP

IP

Data Link (Frames) Physical (Bits, signals, clocking)

F D D I

Dial on Demand

SDLC

HDLC

Frame Relay

PPP

V.24 V.35 G.703 EIA/TIA-232

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 24

Chapter 1 Internet Connection of

TCP/IP
Chapter 2 Data Encapsulation of TCP/IP Protocol Stack Chapter 3 Case Analysis

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 25

The Encapsulation Process of TCP/IP Protocol Stack


user data

Application
App header User data

TCP
TCP Segment TCP header User data

IP Packet

IP header

TCP header

User data

IP

Ethernet header 14B

IP header 20-64B

TCP header 20-60B Ethernet Frame 46-1500 bytes

user data

Ethernet trailer 4B

Application drive

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 26

TCP Segment
Ethernet Frame

Ethernet header

IP header

TCP header

User data

Ethernet trailer

14B

20-60B 20B-60B

4B

Source Port

Dest. Port

Seq Num

Ack Num

...

Option

16b

16b

32b

32b

64b

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 27

IP Packet
Ethernet header IP header TCP header User data Ethernet trailer

14B

20-60B 20B-60B

4B

0 version

15 16 Message Service type length Total length

31

identification Fixed message header


Time to live protocol

Flag

Chip offset
20B

Message header checksum

Source IP address

Destination IP address IP options

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 28

Issue of IP Fragment
Fragment principle: comparing with data length and MTU, if the former is

larger than the latter, fragment is needed.

IP packet
Host Host

MTU

MTU

Fragment on sending end Fragment on the middle routers

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 29

Ethernet Frame
Ethernet header IP header TCP header User data Ethernet trailer

14B

20-60B 20B-60B

4B

DMAC

SMAC

L/T

6B

6B

2B

Length/Type value
Ethernet_II Length/T > 1500

meaning
Represents Type

802.3

Length/T <= 1500

Represents Length

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 30

Chapter 1 Internet Connection of TCP/IP Chapter 2 Data Encapsulation in TCP/IP Protocol Stack Chapter 3 Case Analysis

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 31

Case Analysis (1)

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 32

Case Analysis (2)


Source MAC

Destination MAC

Type

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 33

Case Analysis (3)


Source IP Destination IP

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 34

Case Analysis (4)


Source port

Destination port

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 35

Summary

What layers does OSI RM divide into? Whats the function of each layer of

TCP/IP protocol stack?


whats the process of message

encapsulation and de-encapsulation in TCP/IP protocol stack?


Whats the difference between MAC

address and IP address?

HUAWEI TECHNOLOGIES CO., LTD..

All rights reserved

Page 36

T Thank You

www.huawei.com