Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP/IP 陳彥文.

Similar presentations


Presentation on theme: "TCP/IP 陳彥文."— Presentation transcript:

1 TCP/IP 陳彥文

2 傳統上,人們將數據或文件等視為資料(Data);當通信技術成為日常生活的一部份後,發現除了語音可通信外,數據及視訊通信也是重要的應用。
何謂資料? IEEE對Data的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication, interpretation, or processing by human or automatic means. 傳統上,人們將數據或文件等視為資料(Data);當通信技術成為日常生活的一部份後,發現除了語音可通信外,數據及視訊通信也是重要的應用。 資訊 --- 包含 Voice, Data, Fax, Video, etc.

3 資訊需依據各中種不同處理及應用的需要,做適當的格式(Format)轉換以另一種方式表達(Representation)。
Functions, Works, ----> Program Program ----> Assembly code, Machine code (Processor-dependent) 流水帳 ----> 各種有意義的報表 非標準格式資料(資訊) ----> 共通、標準且易於處理的格式 任何資訊要在通信網路上傳送,也必須將資訊Represent成適合通信的格式。

4 對目前網路而言,資訊大都先轉為Digital(0與1的信號)後,再在網路上傳送。
數位傳送的資訊對不同的應用,各有不同的意義及格式。例如:數據資料用的ASCII, EBCDIC碼、語音的A-Low、u-Low、視訊的MPEG等。 0與1在傳輸線上的表現方式: +Voltage 0 Volts 較常用的表現方式則包括Unipolar, Bipolar, RZ, 及NRZ幾種

5 Data Conversion Compres. Dagital Transmission Data Conversion Uncompres. Sampling ADC Data conv./ Compres. Analog Transmission Filter DAC Data conv./ Uncompres.

6 Conversion from analog into Digital
Conversion: Sampling (rate) --> Quantization (bit) If a signal is to be reconstructed as the original signal it must sampled at a rate defined by the Nyquist criterion: The sampling rate must be twice the highest frequency of the signal

7 Compression Methods Lossless compression: 資料保持正確性
Lossy compression: 分析重要影響資訊與不重要影響資訊, -- Voice, Video e.g. 24-bit color information (16.7 million colors) v.s. 10-bit color information (1024 colors) are only a little dofference to eye.

8 網路概念 Packet Switch (分封交換) v.s. Circuit Switch (電路交換)
電路交換 - 網路提供一條Dedicate的通路(Channel)專供收/送兩端專用。 例如: 電話網路等 分封交換 - 網路提供通信資源(通路、頻寬等)給大家共用,並未專屬於任一使用者使用者將資料切成符合網路標準的資料封包(Packet),由網路送到收端 ----> Virtual Circuit。 例如: Internet, X.25網路等

9 Connection oriented v.s. Connectionless
Connection oriented -- 送端要送資料前先通知(by signalling或人工)網路,建立收/送端的通道。 ---> 電路交換一定是Connection oriented。 Connectionless -- 送端要送資料前,毋須先行建立收/送端的通道,但在每一送出之封包,均要註明收端住址(Address),網路依其收端住址將資料送達目的地。 ----> 分封交換有可能是Connection oriented也可能是Connectionless。

10 電路交換 B, A B, C A, B A, C B Network A C, B C 分封交換

11 電話網路(Public Switch Telephone Network, PSTN)
傳送的資料分 (1) User Information (2) Signalling Trunk 1 (Analogue) Trunk 2 (Analogue) 4 lines: 2 for communication 2 for A-->B and B-->A supervision signal

12 網路上傳送的訊息,包括 Signaling User Information Supervision Signal (監視網路及用戶狀態)
Control and Registration Signal (Addressing and Handshaking) User Information End-to-end message (對網路為透通性) Network

13 利用語音125us取樣一次(每次8個Bit),及多工的方式可將多個Channel收容在一對線上傳送
125us us us ‧‧ n-1 n Frame n個channels的多工

14 ※ 北美標準PCM第一級多工(T1 or DS1)為24個Channels,即
每一Frame(125us duration)含24channels,8bits/ch,但每一Frame均 有一個bit做為Framing bit (added bit framing),因此, 每一Frame共有 8x24+1= 193 bits T1的速率:193bits/125us = 1544K bits/sec = 1.544Mbps ※歐洲標準PCM第一級多工(E1)為32個Channels,即 每一Frame(125us duration)含32channels,8bits/ch,每一Frame的 第0個Time slot (channel)做Synchronization,沒有Framing bit (added channel framing),因此 每一Frame共有 8x32 = 256 bits E1的速率:256bits/125us = 2048K bits/sec = 2.048Mbps

15 Signalling Channels T1/DS1: E1:
“盜取”每第6個及第12個Frame的最右邊Bit (Least Significant Bit, LSB) ----> 每一channel由64KBps減為56KBps E1: 第16個channel固定做為Signalling Channel ----> 真正提供給User使用為30channels

16 Why Chop a Message/File into Small Units
Error control Congestion/flow control Resource sharing Buffer management Scheduling management Chop a message/file into packets/frames

17 Integrated Services Digital Networks
ISDN is a circuit switched network. Multiplexing technique for the integration of ISDN channels B channel: 64kbps D channel: 16kbps or 64kbps H channel: 384kbps (for H0); 1536kbps (H11); 1920kbps (H12) Interface Basic rate interface (BRI): 2B+D Primary rate interface (PRI): 23B+D; 30B+D

18 Packet v.s. Frame Packet  more logical or software view on the concept of small block of data Frame more hardware or network dependent

19 Open System Interconnection (OSI) Model-- Seven Layers
應用層(Application Layer) 表達層(Presentation Layer) 會議層(Session Layer) 傳輸層(Transport Layer) 網路層(Network Layer) 鏈結層(Data Link Layer) 實體層(Physical Layer)

20 Basic Functions of Protocols
Encapsulation/Decapsulation Segmentation/Reassembly Connection Establishing Flow Control Error Control Multiplexing

21 Layering Protocols 應用層 應用層 表達層 表達層 會議層 會議層 傳輸層 傳輸層 網路層 網路層 鏈結層 鏈結層 實體層
系統 B 應用軟體 X 應用軟體 Y 應用層 應用層通訊協定 應用層 表達層 表達層通訊協定 表達層 會議層 會議層通訊協定 會議層 傳輸層 傳輸層通訊協定 傳輸層 網路層 網路層通訊協定 網路層 鏈結層 鏈結層通訊協定 鏈結層 實體層 實體層通訊協定 實體層 傳輸媒介

22 網路的基本概念(續)

23 Encapsulation/Decapsulation Mechanisms
往下送時訊框包裝 往上送時訊框拆裝 應用軟體 X 資料 應用軟體 Y 應用層 AH 資料 應用層 表達層 PH 資料 表達層 會議層 SH 資料 會議層 傳輸層 TH 資料 傳輸層 網路層 NH 資料 網路層 鏈結層 鏈結層 F A C 資料 FCS F 實體層 位元串 實體層 通訊路徑

24 Connections Multiplexing
Upward Multiplexing: Several layer N connections should be multiplexed into a layer N-1 connection. Downward Multiplexing: a layer N connection uses several layer N-1 connections. 通訊軟體 通訊軟體 通訊軟體 通訊軟體 服務點 向上多工 向下多工 一對一 第 N 層 第 N-1 層

25 Physical Medium Twisted Pair 同軸電纜 光纖(Optical Fiber) Wireless
Shield twisted pair (STP) Unshield twisted pair (UTP) 同軸電纜 光纖(Optical Fiber) Wireless

26 光纖通信基本概念 光纖通信特點 不受電磁干擾 低傳輸損失 體積小、重量輕、耐熱/水性佳 頻寬大 (10^13 ~ 10^16 Hz)
低原料成本 適用於數位傳輸 光纖通信缺點:饋電問題、線路分岐、接續、切割

27 光纖通信系統基本架構 Decoder Out 一般通信系統架構 Decoder Out In 驅動電路 信號放大 光纖 感測器 光纖通信架構
Encoder Decoder In Out Transmission Media Modulator Demodulator 一般通信系統架構 Encoder Decoder Out In 驅動電路 信號放大 光纖 光源 感測器 光纖通信架構

28 光纖通信主要元件 光源種類:發光二極體(LED)、雷射二極體(LD) LED較適用於短距離、小容量光纖通信系統(e.g.用戶迴路)
LD較適用於長距離、大容量光纖通信系統(e.g. 長途中繼系統) LED常用於短波長(0.8~1.0um)、LD則常用於長波長(1.3~1.5um) ---> depends on 材質 目前LED壽命較LD為長,但LD的輸出功率較大

29 光纖通信主要元件(續) 光纖原理與結構 光纖基本上由兩部份組成:核心(Core)與纖殼(Cladding)
Core部份直徑約5~100um, 材質折射率大於Cladding Cladding部份直徑約100~300um 光纖傳輸原理係利用幾何光學中介質不同折射率之全反射原理(Snell定律) 光纖分單模(Single-mode)與多模(Multi-mode)兩種,而依核心折射率的分佈,又可分為Step Index及Graded Index兩種 單模光纖較不會產生波形失真/損失,但核心直徑小,接續耦合時易造成損失

30 光纖通信主要元件(續) 光感測器(檢光元件)之基本原理是將Diode的PN介面施以反向偏壓形成空乏區(無自由電子),此時若接受到入射光的光子能量大於電子能隙時,便會激發自由電子的移動 常見之光感測器有PIN檢光二極體與瀉光二極體(Avalanche Photo Diode, APD)兩種 PIN大約只產出數奈安培(nA)的電流(APD約uA) APD的缺點:複雜、成本高、外加偏壓大、易受溫度影響

31 光纖的損失原因 固有損失 吸收損失 光散亂(Dispersion) 外部加力產生的損失 光纖畸變、彎曲等 人為因素 光元件耦合
連接損失:端面不平、有切角、核心面積不對稱、沒對準等

32 網際網路之功能 Internet - 網際網路(Internet)是網路所構成的網路 (Network of Networks)
- 透過網際網路可達到資源/資料共享、訊息交換的目的 LAN Internet LAN

33 Definition of Local Area Network
IEEE: A LAN is a data communication system allowing a number of independent devices to communicate directly with each other, within a moderately sized geographic area over a physical communications channel of moderate dada rates .

34 Network Topologies Star Single Star (IEEE 802.12 100VG-AnyLAN, ATM)
Multiple Star (Snowflake) (ATM) Bus Single Bus (IEEE CSMA/CD, IEEE Token-Bus) Dual Bus (IEEE DQDB) Tree Ring Single Ring (IEEE Token Ring) Dual Ring (FDDI, FDDI-II) Mesh

35 Access Control Methods
Network Topologies Star Topology Bus/Tree Topology Ring Topology Mesh Topology Transmission Control Random Transmission Control Distributed Transmission Control Centralized Control

36 Transmission Control Random Transmission Control
ALOHA Network, Wireless LAN Carrier Sense multiple access with collision detection (CSMA/CD) Slotted Ring Register Insertion Ring Distributed Transmission Control Token Passing : Token-Ring (FDDI), Token-Bus (GM, MAP) Carrier Sense multiple access with collision avoidance (CSMA/CA) Distributed Queue Dual Bus (DQDB) Centralized Control Polling Circuit Switching (X.25, Frame-Relay, ATM network) Time-division Multiple Access (TDMA) Frequency-division Multiple Access (FDMA) Wavelength-division Multiple Access (WDMA) Code-division Multiple Access (CDMA)

37 IEEE Project 802 Standards
IEEE High Level Interface IEEE 802.1D Local Bridge (Spanning Tree Algorithm) IEEE 802.1G Remote Bridge IEEE LLC (Logical Link Control) IEEE CSMA/CD (Carrier Sense Multiple Access with Collision Detection; Fast Ethernet/Gigabit Ethernet IEEE Token-Bus IEEE Token-Ring IEEE DQDB (Distributed Queue Dual Bus) IEEE Broadband Technical Advisory Group IEEE Fiber Optic Technical Advisory Group IEEE Integrated Voice and Data LAN Working Group IEEE LAN Security Working Group IEEE Wireless LAN IEEE Demand-Priority (100VG-AnyLAN) ATM Basic

38 Bus Topology - Ethernet

39 Ring Topology – Token Ring

40 Ring Topology - FDDI

41 Star Topology - ATM ATM Switch

42 Layer 2 v.s. Layer 3 LAN LAN LAN R R R R R R End to end Link by link
Routing Routing Routing Routing End to end Link by link LAN LAN LAN R R R R R R

43 Unique Flag (Pattern) in bit oriented protocol
Flag Address Control Information FCS Flag Flag Zero bit insertion technique - <i> Flag pattern為單一 <ii> 的資訊能順利傳送 ,不會混淆 方法 - 傳送資料時,逢五個連續1則插入一個0

44 Layer 2 – EtherFrame Format

45 Layer 2 – Ethernet Frame Type
Frame type value Meaning DC Reserved 0800 Internet Protocol 0805 X.25 6559 Frame Relay Novell IPX 0806 Address Resolution Protocol (ARP) …..

46 Major Technologies in Layer 2
Technology CO/CL LAN WAN Token Ring CL X FDDI Ethernet ATM CO Frame Relay SMDS

47 Internet Overview Various Applications IP IP IP MAC MAC MAC PHY PHY
TCP/UDP TCP/UDP IP IP IP MAC MAC MAC PHY PHY PHY Internet

48 TCP and UDP TCP ---> Connection oriented connection
Connection establishment and release Sequence number UDP ---> Connectionless connection Datagram services

49 應用 Transport TCP UDP Net. IP Data link IEEE 802系列 Phy.
Ping, Telnet, FTP, Rlogin, … RPC, SNMP, ... Transport TCP UDP Net. IP Data link IEEE 802系列 Phy.

50

51 IPv6與IPv4之比較 IPv4 Packet Header IPv6 Packet Header 32 bits 32 bits
Ver. 32 bits 32 bits Service Type Pri- ority IHL Total Length Ver. Flow Label Identification Frag Offset Payload Length Flags Next Header Hop Limit Protocol Type Source Address Time to Live Header Checksum Source Address Source Address Destination Address Source Address Options + Padding Source Address Destination Address Destination Address Destination Address Destination Address

52 Routing -- Routing table in Router
Eth 2 Eth 0 Router R Eth 3 Eth 1 R R Destination Interface Eth0 Eth1 Eth2 R R

53 Routing --Address Classes
3 Address Classes in Internet Class A Class B Class C Use network number to route a packet to the destination 10 110

54 Max. of Hosts per Network
IP Address Address Class Bits in Prefix Range of Values Max. of Networks Max. of Hosts per Network A 7 0~127 128 B 14 128~191 16384 65536 C 21 192~223 256 D 20 224~239 -- E 240~255

55 IP Address The IP address is not only an identify for a specific device in internet, it also identifies a connection between the device and a network. Each port of a router shall be assigned one IP address.

56 Routers and IP Addressing

57 IP Networks and Routing
Interior Routing Protocols RIP (Routing Information Protocol) OSPF (Open Shortest Path First) Other Protocols Exterior Routing Protocols EGP (Exterior Gateway Protocol) BGP (Border Gateway Protocol) v.s. CIDR (Classless Inter Domain Routing) Policy Routing

58 RIP RIP is a simple protocol based on “Bellman Ford” protocol  distance vector Overview of distance vector routing Start up Link breaks Bouncing effect Counting to infinity Improvement schemes  split horizon; triggered updates Decrease the time to converge

59 Comparison of RIPv1(rfc-1058, 1988) and RIPv2 (rfc-2453, 1998)
Subnet routing – support subnet mask information Authentication – simple password protection defined in 2453, and MD5 is defined in rfc-2082 Next hop indication Multicasting – define IP class D address for information advertisement.

60 OSPF Link state routing v.s. distance vector routing
Link state routing protocols are based on the “distributed map” concept Changing information of the network is achieved by flooding protocol Main issue – to maintain a synchronized copy of the link state database in all nodes of the network  secure map updates Shortest path first  Dijkstra algorithm

61 Why is a link state protocol better?
Fast, loopless convergency Support of precise/multiple metrics The largest throughput; the lowest delay; the lowest cost; the best reliability; … Metric per system v.s. metric per packet (OSPFv2) Support multiple paths to a destination Traffic splitting Separate representation of external routes

62 Protocols within RIP and OSPF
RIP packets are carried over UDP/IP with port 520 Packets are sent every 30 seconds, or faster when triggered updates If a route is not refreshed within 180 seconds (6x30), the distance is set to infinity Each entry (one route) of RIP message is encoded over 20 bytes long (reservation part is used in RIPv2 for authentication, and etc.)

63 Protocols within RIP and OSPF
OSPF runs on top of of the IP layer with protocol type 89 Composes of 3 subprotocols Hello: for checking the operation of the link and elect the designated/backup routers Exchange: master/slave operation for exchange the routing information in DB Flooding: to maintain the synchronization of the two databases

64 Other Routing Protocols
Intermediate System to Intermediate System (IS-IS) Defined by ISO in 1980s for DECnet (especially in the Backbone) and many concepts of IS-IS were adopted by OSPF IGRP (Internet Group Management Protocol) Similar to ICMP and is a proprietary protocol defined by Cisco Distance vector family protocol Composite metrics: delay (D), bandwidth (B), reliability (R), load (L)

65 Exterior Routing Protocols
Splitting the internet into autonomous systems (AS) Concept of AS The minimum AS is composed of exactly one router directly connecting one LAN to Internet An As can “self-routing” within its local network Hierarchical (two) level routing Exterior routing is to exchange routing information among ASs

66 Exterior Gateways’ Protocol (EGP)
EGP is run over IP with protocol type number 8 EGP Messages Neighbor acquisition: to determine two adjacent gateways agree to become neighbors Neighbor reachability: to monitor the links Network reachability: exchange the reachability information

67 EGP Protocol NA  NR  NetR
Neighbor acquisition is a two-way handshake procedure; while the partner may refuse Neighbor reachability uses “hello” and “I heard you” (I-H-U) packets to check the link “Dual threshold” procedure is used to avoid oscillation A reachable link is declared to be unreachable if fewer than “I-H-U”s have been received for the last “hello”s. An unreachable link is declared to be reachable only if at least “I-H-U”s have been received for the last “hello”s.

68 EGP Protocol AS “Z” (transit) AS “X” A B E F AS “Y” D C

69 BGP The main issue of BGP: large routing information and memory/CPU power requirement – “BGP-4 Protocol Analysis, “rfc-1774, March, 1995. History of BGP: BGP-1 (rfc-1105, 1989); BGP-2 (rfc-1163, June, 1990); BGP-3 (rfc-1267, Oct., 1991); BGP-4 (rfc-1654, 1994, rfc-1771, 1995) BGP v.s. Calssless Inter-Domain Routing (CIDR) – CIDR was proposed in 1993~1995 Reduce routing table size Route aggregation

70 BGP BGP is run over TCP/IP (with port number 179) Packet types of BGP
TCP provides a reliable data transmission link (with fair flow/congestion control), however, Routing update packet to cure network congestion,… Security issue (rfc-2385, 1998 – Protection of BGP Sessions via TCP MD5 Signature Option”) Packet types of BGP OPEN UPDATE NOTIFICATION KEEPALIVE

71 BGP Initial exchange Updates
Use OPEN packet to check the BGP version and the “hold time” (the number of seconds used by the “keep alive procedure”) Use UPDATE packet to exchange (list of) “withdrawn routes” and metrics information of each path Updates Loop protection Stable – the path shall not oscillate too rapidly between reachable and unreachable

72 BGP Keep alive Error Notifications
According to the “hold time” value, and the keep alive messages will not exchanged for zero hold time. Error Notifications Message header error OPEN message error UPDATE message error Hold time expired Finite state machine error Cease (terminate the association)

73 IPv4 Header 32 bits Source Address Destination Address
Service Type Ver. IHL Total Length Identification Flags Frag Offset Protocol Type Time to Live Header Checksum Source Address Destination Address Options + Padding Version: IP protocol version (currently, 4) IHL: Internet Header Length (in 4-byte unit, value=5 if no option) Service Type: 3-bit for precedence, 3-bit flags for (D)elay, (T)hroughput, (R)eliability) Total Length: Total length of the packet (including header and payload) Identification: Packet ID, used with fragmentation Time to live: Packet live time (original in seconds, currently, number of hops) Header Checksum: Error check for IP header

74 IP Fragmentation and Reassembly
Concept of Maximum Transmission Unit (MTU) Each hardware (physical network) specifies the maximum amount of data that a frame can be carried. The hardware is not designed to accept or transmit frames that carry more data than the MTU allows. The internet contains heterogeneous networks, and therefore, the frames shall be fragmented when its frame size can not fit into the MTU size of the network to be transmitted

75 IP Fragmentation and Reassembly

76 IP Fragmentation and Reassembly
All fragmented packets have the same packet identification with the original packet. The total length and header checksum shall be re-calculated. The fragmentation offset is used to determine the fragmented packets when they arrived the destination Two flags DF: De-fragment MF: More fragment

77 IP Fragmentation and Reassembly
The fragmented packets are reassembled at the end destination: Reduce the amount of state information in routers Allow routes to be changed dynamically (remember that the IP network is connectionless)

78 IP Fragmentation and Reassembly
Fragment Loss IP network does not guarantee the reliable packet forwarding  fragment may loss The receiver can not hold some fragments of a packet for an arbitrary long time.  timer starts when the first fragment received. If all fragments of a packet can not received before timer expired, all fragments are discarded and this packet is lost. There is no mechanism for a receiver to tell the sender which fragments have arrived

79 IP Header – Protocol Type
The protocol type specifies the protocol used in transport layer ICMP 1 IP 4 TCP 6 UDP 17 EGP 8 RSVP 46 …..

80 Frame, IP, TCP/UDP TCP/UDP datagram IP Packet (datagram) LAN Frame
LAN IP TCP/UDP Data LAN Header Header Header (Higher Layer PDU) Trailer TCP/UDP datagram IP Packet (datagram) LAN Frame

81 Hardware Address v.s. IP (Software) Address
IP Address (S, D) Network Layer MAC (S, D) MAC (S, D) MAC (S, D) MAC (S, D) MAC (S, D) MAC (S, D) Link Layer LAN LAN LAN R R R R R R

82 Address Resolution Protocol
Address Resolution Techniques Table lookup: centralized Closed-from computation: configured address Message exchange: distributed computing

83 Address Resolution Protocol

84 Address Resolution Protocol
ARP message format is sufficiently general to allow arbitrary protocol and hardware address. The following format is used in Ethernet Operation: value 1 for request and value 2 for response

85 Address Resolution Protocol
In order to reduce the network traffic, ARP extracts and saves the information from a response so it can be used for subsequence packets.  Caching The caching table is maintained by the ARP software – normally, the oldest entry is replaced whenever a response arrival. The address information is valid for a predefined period of time (e.g. 20 minutes)

86 Internet Control Message Protocol
ICMP is designed for the error detection and information reporting during the transferring of IP packets. ICMP can be used as a passive tool to gather the network information, it can also applied as the “active” tool to assist the packet forwarding.

87 Internet Control Message Protocol
Examples of ICMP message types: Source Quench (type=4): To indicate that the router has no more available buffer space available. Destination Unreachable (type=3): A router determines that a datagram cannot be delivered to its destination (due to various causes, e.g. DF) Echo request (type=8) Echo reply (type=0) Time exceed (type=11): For packets whose TTL=0 Traceroute (type=30)

88 Internet Control Message Protocol
Applications of ICMP Test the reachability: the “ping” program uses the “echo request” and “echo reply” messages. Trace route: the “traceroute” message may set the TTL field for route tracing. MTU discovery: to find the MTU of a route by sending various-size packets with DM=1

89 Transport Layer Protocols
TCP UDP IP Network Layer

90 TCP Source Port Destination Port Sequence Number
Acknowledgement Number THL Reserved Flags Window Checksum Urgent Pointer

91 UDP Source Port Destination Port Length Checksum Data

92 TCP/UDP Port number: specify the end-point (e.g. application, service) of a connection The IP address and the port number form a 48-bit TSAP (Transport Service Access Point) Sequence number (TCP): specify the sequence of the current datagram Acknowledgement number (TCP): specify the “expected” number of datagram to be received UDP length: the length of the UDP datagram (including the 8-byte UDP header)

93 Flags in TCP Header URG: to indicate that the “Urgent Pointer” is in use. The urgent pointer is used to indicate a byte offset from the current sequence number at which urgent data are to be found. ACK: to indicate the acknowledgement number field is valid. PSH: to request the receiver to push the data to the application (not to buffer it). RST: to reset a connection that has become confused due to a host crash or some other reason. SYN: to establish a connection (SYN=1, ACK=0) FIN: to release a connection.

94 Some TCP/UDP Port Numbers
ftp-data 20 telnet 23 smtp 25 login 49 www-http 80 DNS 53 BGP 179 SNMP 161 …… ……….

95 TCP Characteristics of TCP services Connection oriented
Point-to-point communication Reliable communication Full duplex communication Reliable connection start up Graceful connection shutdown

96 TCP Connection Establishment
S/R S/R S R SYN(SEQ=x) SYN(SEQ=x) SYN(SEQ=y) SYN(SEQ=y, ACK=x+1) SYN(SEQ=y, ACK=x+1) (SEQ=x+1, ACK=y+1) SYN(SEQ=x, ACK=y+1) Three-way Handshake (SEQ=x+1, ACK=y+1)

97 TCP Connection Sequence/Ack Number Establishment Data Transfer Release
SYN Packet SYN/Ack Establishment Ack Sequence/Ack Number Data Transfer FIN FIN/Ack Release Ack

98 Retransmission in TCP

99 TCP Congestion/Flow Control
Timer is important in reliable (acknowledgement) communication If timer is too short  enable duplicate packet transmission If timer is too long  ineffective and waste network resources

100 TCP Flow Control Functions of flow control: Actions of flow control
To control the packet delay To control the packet loss Speed matching (flow control v.s. congestion control) Actions of flow control Call blocking, packet discarding, packet blocking, packet scheduling

101 Transmission Delay v.s. Window
Consider that the sender transmits a packet to the destination and waits for the ack. Message.  Sender and network are idle during this time  Consecutive sending packets  window (limited traffic volume) control is required for traffic regulation.

102 TCP Congestion/Flow Control
TCP applies the “window” to regulate the packet flow. TCP is an end-to-end flow control. Thus, the flow control operation is performed at the end system. The network condition will affect the window size.

103 TCP Congestion/Flow Control
In TCP, the window size is controlled by the received. Theoretically, the window size may be larger as the round-trip delay is longer. The network condition is changeable, therefore, a better way is to make the “window size” dynamically adjustable according to the network condition.

104 TCP Congestion/Flow Control

105 TCP Congestion/Flow Control
Larger Window Size Long Round-Trip Time If network Congested  Packet loss More packets on the way

106 TCP Congestion/Flow Control
Dynamic window size adjustment in TCP The TCP connection transmits packet from slow start (e.g. single message containing data), if ack. Received, then doubles the window size.  exponential incremental until the half of the advertised window size, at which linear incremental is applied. The window size is backing off quickly if congested. – Fast recovery

107 TCP Congestion/Flow Control
Initial send: 64K –fail threshold is set to be half (32K) Transmission 13 is time out backing of and threshold set to be half of 40K

108 Threats in TCP Protocols
SYN flooding attack: Exhaust the system resources (memory, computing power, etc.) by sending huge SYN packets for connections and without ack. for system’s SYN/ack. Session hijacking: intercept the connection by “de-synchronization” and “re-synchronization” the sequence number.

109 Threats in TCP Protocols – SYN Flooding

110 Threats in TCP Protocols - Hijacking
Hacker Reject Server Disturb Sequence Number Client

111 Future IP Network – IPv6 and QoS

112 ‘97 Q2 ‘99 Q3 ‘99 Q4 ‘00 Q1 ‘00 Q2 ‘00 Q3 ‘00 Q4

113 !!! 2005! IPv6 您或許知道現在所用的Internet 通信協定是IPv4!
Total Time Volume 2005! !!!

114 IPv6 v.s. IPv4 IPv4 PDU ... IPv6 PDU IPv4 Header Data Field
maximum 65535 octets minimum 20 octets IPv4 Header Data Field IPv4 PDU maximum 65535 octets Fixed 40 octets 0 or more Extension Header ... Extension Header IPv6 Header Data Field IPv6 PDU

115 IPv6 Header IPv6 Packet Header 32 bits Source Address Source Address
Pri- ority Ver. Flow Label Payload Length Next Header Hop Limit Source Address Source Address Source Address Source Address Destination Address Destination Address Destination Address Destination Address

116 IPv6 v.s. IPv4 -- overview Main Changes in Protocol Header
Five fields are suppressed IP Header length --> due to fixed header size Header check sum --> performed in the lower (MAC) layer Identification, Flags, and Fragment offset --> fragment will not support inside the network (only end-to-end) Type of service --> replaced by Priority Three fields are renamed Length --> Payload length Payload type --> Next Header Time to live --> Hop limit Two new fields Priority, and Flow label --> support QoS

117 IPv6 v.s. IPv4 -- overview Header Size is fixed and the optional fields are replaced by the Extension Headers (e.g. hop-by-hop header, authentication header, etc.) 12 fixed + options -----> 8 fixed + extension Enhanced Functionality Scoping in multicast address Anycast address Single interface with multiple address Use “flow” concept for QoS management

118 Internet QoS – The big picture
Internet QoS service categories Best-effort services Provided in current internet Relied on the end-to-end TCP-like congestion control Controlled load service: a service that is close to a lightly loaded best-effort network Guaranteed service: provides deterministic worst-case delay bound through strict admission control and fair queuing scheduling


Download ppt "TCP/IP 陳彥文."

Similar presentations


Ads by Google