tcp/ip 陳彥文. ywchen-tcp/ip 何謂資料? ieee 對 data 的定義為 -- a representation of...

118
TCP/IP 陳陳陳

Upload: isabella-gallagher

Post on 18-Jan-2016

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

TCP/IPTCP/IP

陳彥文

Page 2: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

何謂資料? 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.

Page 3: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

資訊需依據各中種不同處理及應用的需要,做適當的格式 (Format) 轉換以另一種方式表達 (Representation) 。 Functions, Works, ----> Program Program ----> Assembly code, Machine code (Processor-dependen

t) 流水帳 ----> 各種有意義的報表 非標準格式資料 ( 資訊 ) ----> 共通、標準且易於處理的格式

任何資訊要在通信網路上傳送,也必須將資訊 Represent 成適合通信的格式。

Page 4: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

對目前網路而言,資訊大都先轉為 Digital(0 與 1 的信號 ) 後,再在網路上傳送。

數位傳送的資訊對不同的應用,各有不同的意義及格式。例如:數據資料用的 ASCII, EBCDIC 碼、語音的A-Low 、 u-Low 、視訊的 MPEG 等。

0 與 1 在傳輸線上的表現方式:

1 0+Voltage

0 Volts

•較常用的表現方式則包括 Unipolar, Bipolar, RZ, 及 NRZ 幾種

Page 5: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Data Conversion

Uncompres.

Compres.

Data Conversion

Transmission

Sampling

Data conv./Uncompres.

Data conv./Compres.

Filter

Transmission

ADC

DAC

Dagital

Analog

Page 6: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Conversion from analog into DigitalConversion 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 frequ

ency of the signal

Page 7: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Compression MethodsCompression Methods

Lossless compression: 資料保持正確性 Lossy compression: 分析重要影響資訊與不重要影響資訊 , -- Voice, Videoe.g. 24-bit color information (16.7 million colors)

v.s. 10-bit color information (1024 colors) are only a little dofference to eye.

Page 8: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

網路概念 Packet Switch ( 分封交換 ) v.s. Circuit Switch ( 電路交換 ) 電路交換 - 網路提供一條 Dedicate 的通路 (Chann

el) 專供收 / 送兩端專用。例如: 電話網路等

分封交換 - 網路提供通信資源 ( 通路、頻寬等 )給大家共用,並未專屬於任一使用者使用者將資料切成符合網路標準的資料封包 (Packet) ,由網路送到收端----> Virtual Circuit 。

例如: Internet, X.25 網路等

Page 9: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Connection oriented v.s. Connectionless Connection oriented -- 送端要送資料前先通知 (by s

ignalling 或人工 ) 網路,建立收 / 送端的通道。---> 電路交換一定是 Connection oriented 。

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

Page 10: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

電路交換

NetworkAB

C

A, B A, CB, A B, C

C, B

分封交換

Page 11: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

電話網路 (Public Switch Telephone Network, PSTN)傳送的資料分 (1) User Information

(2) Signalling

4 lines: 2 for communication 2 for A-->B and B-->A supervision signal

Trunk 1 (Analogue)

Trunk 2 (Analogue)

Page 12: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

網路上傳送的訊息,包括 Signaling

Supervision Signal ( 監視網路及用戶狀態 ) Control and Registration Signal (Addressing and Handshakin

g)

User Information End-to-end message ( 對網路為透通性 )

Network

Page 13: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

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

‧‧1 2 n-1 n

Frame

125us 125us 125us

n 個 channels 的多工

Page 14: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

※ 北美標準 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

Page 15: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Signalling Channels T1/DS1:

“盜取”每第 6 個及第 12 個 Frame 的最右邊 Bit (Least Significant Bit, LSB)

----> 每一 channel 由 64KBps 減為 56KBps

E1: 第 16 個 channel 固定做為 Signalling Channel

----> 真正提供給 User 使用為 30channels

Page 16: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Why Chop a Message/File into Small Units

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

Page 17: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Integrated Services Digital Networks

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

Page 18: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Packet v.s. FramePacket v.s. Frame

Packet more logical or software view on the concept of small block of data

Frame more hardware or network dependent

Page 19: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Open System Interconnection (OSI) Model-- Seven Layers

應用層 (Application Layer)

表達層 (Presentation Layer)

會議層 (Session Layer)

傳輸層 (Transport Layer)

網路層 (Network Layer)

鏈結層 (Data Link Layer)

實體層 (Physical Layer)

Page 20: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Basic Functions of Protocols

Encapsulation/Decapsulation Segmentation/Reassembly Connection Establishing Flow Control Error Control Multiplexing

Page 21: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Layering Protocols

應用層

表達層

會議層

傳輸層

網路層

鏈結層

實體層

應用層

表達層

會議層

傳輸層

網路層

鏈結層

實體層

應用軟體 X

鏈結層通訊協定

傳輸媒介

應用軟體 Y

網路層通訊協定

傳輸層通訊協定

會議層通訊協定

表達層通訊協定

應用層通訊協定

實體層通訊協定

系統 A 系統 B

Page 22: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

網路的基本概念 (續 )網路的基本概念 (續 )

Layer 1

Layer 2

.........Layer N

SAP

SAP

SAPLayer 1

Layer 2

.........

Layer NSAP

SAP

SAP

Protocol (N)

Protocol (2)

Protocol (1)

Page 23: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Encapsulation/Decapsulation Mechanisms

應用層

表達層

會議層

傳輸層

網路層

鏈結層

實體層

應用層

表達層

會議層

傳輸層

網路層

鏈結層

實體層

應用軟體 X

AH

PH

SH

TH

NH

資料

資料

資料

資料

資料

資料

資料 F A C FCS F

位元串

通訊路徑

應用軟體 Y

往下送時訊框包裝 往上送時訊框拆裝

Page 24: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

第 N-1 層

第 N 層

服務點

一對一向上多工 向下多工

通訊軟體通訊軟體

通訊軟體

通訊軟體

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.

Page 25: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Physical MediumPhysical Medium

Twisted Pair Shield twisted pair (STP) Unshield twisted pair (UTP)

同軸電纜光纖 (Optical Fiber) Wireless

Page 26: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

光纖通信基本概念光纖通信基本概念

光纖通信特點 不受電磁干擾 低傳輸損失 體積小、重量輕、耐熱 / 水性佳 頻寬大 (10^13 ~ 10^16 Hz) 低原料成本 適用於數位傳輸

光纖通信缺點:饋電問題、線路分岐、接續、切割

Page 27: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

光纖通信系統基本架構光纖通信系統基本架構

Encoder

Modulator Demodulator

Decoder

Transmission Media

In Out

一般通信系統架構

Encoder

驅動電路 信號放大

Decoder

光纖光源 感測器

In Out

光纖通信架構

Page 28: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

光纖通信主要元件光纖通信主要元件

光源種類:發光二極體 (LED) 、雷射二極體 (LD) LED 較適用於短距離、小容量光纖通信系統 (e.

g. 用戶迴路 ) LD 較適用於長距離、大容量光纖通信系統 (e.g.

長途中繼系統 ) LED 常用於短波長 (0.8~1.0um) 、 LD 則常用於長波長 (1.3~1.5um) ---> depends on 材質

目前 LED壽命較 LD 為長,但 LD 的輸出功率較大

Page 29: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

光纖通信主要元件 ( 續 )光纖通信主要元件 ( 續 )

光纖原理與結構 光纖基本上由兩部份組成:核心 (Core) 與纖殼 (Cladding)

Core 部份直徑約 5~100um, 材質折射率大於 Cladding Cladding 部份直徑約 100~300um

光纖傳輸原理係利用幾何光學中介質不同折射率之全反射原理 (Snell 定律 )

光纖分單模 (Single-mode) 與多模 (Multi-mode) 兩種,而依核心折射率的分佈,又可分為 Step Index 及 Graded Index 兩種

單模光纖較不會產生波形失真 / 損失,但核心直徑小,接續耦合時易造成損失

Page 30: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

光纖通信主要元件 ( 續 )光纖通信主要元件 ( 續 )

光感測器 (檢光元件 ) 之基本原理是將 Diode 的 PN介面施以反向偏壓形成空乏區 (無自由電子 ) ,此時若接受到入射光的光子能量大於電子能隙時,便會激發自由電子的移動

常見之光感測器有 PIN檢光二極體與瀉光二極體 (Avalanche Photo Diode, APD) 兩種 PIN 大約只產出數奈安培 (nA) 的電流 (APD約 uA) APD 的缺點:複雜、成本高、外加偏壓大、易受溫度影響

Page 31: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

光纖的損失原因光纖的損失原因

固有損失 吸收損失 光散亂 (Dispersion)

外部加力產生的損失 光纖畸變、彎曲等

人為因素 光元件耦合 連接損失:端面不平、有切角、核心面積不對稱、沒對準等

Page 32: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

網際網路之功能 網際網路之功能

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

Internet

LAN

LAN

Page 33: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Definition of Local Area NetworkDefinition 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 .

Page 34: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Network Topologies

Star Single Star (IEEE 802.12 100VG-AnyLAN, ATM) Multiple Star (Snowflake) (ATM)

Bus Single Bus (IEEE 802.3 CSMA/CD, IEEE 802.4 Token-Bus) Dual Bus (IEEE 802.6 DQDB)

Tree Ring

Single Ring (IEEE 802.5 Token Ring) Dual Ring (FDDI, FDDI-II)

Mesh

Page 35: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Access Control Methods

Network Topologies Star Topology Bus/Tree Topology Ring Topology Mesh Topology

Transmission Control Random Transmission Control Distributed Transmission Control Centralized Control

Page 36: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

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)

Page 37: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IEEE Project 802 Standards IEEE 802.1 High Level Interface

IEEE 802.1D Local Bridge (Spanning Tree Algorithm) IEEE 802.1G Remote Bridge

IEEE 802.2 LLC (Logical Link Control) IEEE 802.3 CSMA/CD (Carrier Sense Multiple Access with Collision Detection;

Fast Ethernet/Gigabit Ethernet IEEE 802.4 Token-Bus IEEE 802.5 Token-Ring IEEE 802.6 DQDB (Distributed Queue Dual Bus) IEEE 802.7 Broadband Technical Advisory Group IEEE 802.8 Fiber Optic Technical Advisory Group IEEE 802.9 Integrated Voice and Data LAN Working Group IEEE 802.10 LAN Security Working Group IEEE 802.11 Wireless LAN IEEE 802.12 Demand-Priority (100VG-AnyLAN) ATM Basic

Page 38: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Bus Topology - EthernetBus Topology - Ethernet

Page 39: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Ring Topology – Token RingRing Topology – Token Ring

Page 40: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Ring Topology - FDDIRing Topology - FDDI

Page 41: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Star Topology - ATMStar Topology - ATM

ATM Switch

Page 42: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Layer 2 v.s. Layer 3Layer 2 v.s. Layer 3

R R R RLANLAN LAN

R

R

Link by link

End to endRouting Routing Routing Routing

Page 43: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Unique Flag (Pattern) in bit oriented protocol

Flag Address Control Information FCS Flag

Flag - 01111110

Zero bit insertion technique - <i> Flag pattern 為單一<ii> 01111110 的資訊能順利傳送

,不會混淆方法 - 傳送資料時,逢五個連續 1 則插入一個 0

Page 44: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Layer 2 – EtherFrame FormatLayer 2 – EtherFrame Format

Page 45: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Layer 2 – Ethernet Frame TypeLayer 2 – Ethernet Frame Type

Frame type value Meaning

0000-05DC Reserved

0800 Internet Protocol

0805 X.25

6559 Frame Relay

8137-8138 Novell IPX

0806 Address Resolution Protocol (ARP)

….. …..

Page 46: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Major Technologies in Layer 2Major Technologies in Layer 2

Technology CO/CL LAN WAN

Token Ring CL X

FDDI CL X

Ethernet CL X

ATM CO X X

Frame Relay CO X

SMDS CL X

Page 47: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Internet OverviewInternet Overview

Internet

PHY

MAC

IP

TCP/UDP

PHY

MAC

IP

PHY

MAC

IP

TCP/UDPVarious Applications

Page 48: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP and UDPTCP and UDP

TCP ---> Connection oriented connection Connection establishment and release Sequence number

UDP ---> Connectionless connection Datagram services

Page 49: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Phy.

Data link

Net.

Transport

應用

IEEE 802 系列

IP

TCP UDP

Ping, Telnet, FTP, Rlogin, … RPC, SNMP, ...

Page 50: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Page 51: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

32 bitsIPv4 Packet Header IPv6 Packet Header

Ver.

IHLService

Type Total Length

Identification Flags Frag Offset

Time to Live ProtocolType Header Checksum

Source Address

32 bitsVer.

Pri-ority Flow Label

Payload Length Next Header Hop Limit

Source Address

Source Address

Source Address

Source Address

Destination Address

Destination Address

Destination Address

Destination Address

Destination AddressOptions + Padding

IPv6 與 IPv4 之比較

Page 52: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Routing -- Routing table in Router

Destination

23.0.0.0140.75.0.0203.35.13.0

Interface

Eth0Eth1Eth2

R

R

R

R

R

RouterEth 0

Eth 1

Eth 2

Eth 3

Page 53: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

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

0

Page 54: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IP AddressIP Address

Address Class

Bits in Prefix

Range of Values

Max. of Networks

Max. of Hosts per Network

A 7 0~127 128 16777216

B 14 128~191 16384 65536

C 21 192~223 2097152 256

D 20 224~239 1048576 --

E 20 240~255 1048576 --

Page 55: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IP AddressIP 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.

Page 56: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Routers and IP AddressingRouters and IP Addressing

Page 57: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IP Networks and RoutingIP 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

Page 58: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

RIPRIP

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

Page 59: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Comparison of RIPv1(rfc-1058, 1988) and RIPv2 (rfc-2453, 1998)

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.

Page 60: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

OSPFOSPF

Link state routing v.s. distance vector routing Link state routing protocols are based on the “distribute

d map” concept Changing information of the network is achieved

by flooding protocol Main issue – to maintain a synchronized copy of t

he link state database in all nodes of the network secure map updates

Shortest path first Dijkstra algorithm

Page 61: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Why is a link state protocol better?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

Page 62: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Protocols within RIP and OSPFProtocols within RIP and OSPF

RIP 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.)

Page 63: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Protocols within RIP and OSPFProtocols within RIP and OSPF

OSPF OSPF runs on top of of the IP layer with protoc

ol 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

Page 64: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Other Routing ProtocolsOther 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 b

y Cisco Distance vector family protocol Composite metrics: delay (D), bandwidth (B), reliabilit

y (R), load (L)

Page 65: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Exterior Routing ProtocolsExterior Routing Protocols

Splitting the internet into autonomous systems (AS)

Concept of AS The minimum AS is composed of exactly one router dir

ectly connecting one LAN to Internet An As can “self-routing” within its local network

Hierarchical (two) level routing Exterior routing is to exchange routing informatio

n among ASs

Page 66: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Exterior Gateways’ Protocol (EGP)Exterior Gateways’ Protocol (EGP)

EGP is run over IP with protocol type number 8

EGP Messages Neighbor acquisition: to determine two adjacen

t gateways agree to become neighbors Neighbor reachability: to monitor the links Network reachability: exchange the reachability

information

Page 67: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

EGP ProtocolEGP Protocol

NA NR NetR Neighbor acquisition is a two-way handshake proce

dure; 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.

in

jm

Page 68: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

EGP ProtocolEGP Protocol

AS “Z”(transit)

AS “X”

AS “Y”

A

E

F

CD

B

Page 69: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

BGPBGP

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) – CID

R was proposed in 1993~1995 Reduce routing table size Route aggregation

Page 70: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

BGPBGP

BGP is run over TCP/IP (with port number 179) TCP provides a reliable data transmission link (with fair flo

w/congestion control), however, Routing update packet to cure network congestion,… Security issue (rfc-2385, 1998 – Protection of BGP Sessions via TC

P MD5 Signature Option”)

Packet types of BGP OPEN UPDATE NOTIFICATION KEEPALIVE

Page 71: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

BGPBGP

Initial exchange 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

Page 72: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

BGPBGP

Keep alive 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)

Page 73: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IPv4 HeaderIPv4 Header

32 bitsVer. IHL

Service Type Total Length

Identification Flags Frag Offset

Time to Live ProtocolType Header Checksum

Source AddressDestination 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 fragmentationTime to live: Packet live time (original in seconds, currently, number of hops)Header Checksum: Error check for IP header

Page 74: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IP Fragmentation and ReassemblyIP 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

Page 75: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IP Fragmentation and ReassemblyIP Fragmentation and Reassembly

Page 76: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IP Fragmentation and ReassemblyIP 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

Page 77: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IP Fragmentation and ReassemblyIP 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)

Page 78: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IP Fragmentation and ReassemblyIP 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

Page 79: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IP Header – Protocol TypeIP 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

….. …..

Page 80: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Frame, IP, TCP/UDPFrame, IP, TCP/UDP

LAN IP TCP/UDP Data LAN Header Header Header (Higher Layer PDU) Trailer

LAN Frame

IP Packet (datagram)

TCP/UDP datagram

Page 81: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Hardware Address v.s. IP (Software) Address

Hardware Address v.s. IP (Software) Address

R R R RLANLAN LAN

R

R

Link Layer

Network LayerIP Address (S, D)

MAC(S, D)

MAC(S, D)

MAC(S, D)

MAC(S, D)

MAC(S, D)

MAC(S, D)

Page 82: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Address Resolution ProtocolAddress Resolution Protocol

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

Page 83: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Address Resolution ProtocolAddress Resolution Protocol

Page 84: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Address Resolution ProtocolAddress Resolution Protocol

ARP message format is sufficiently general to allow arbitrary protocoland hardware address. The following format is used in Ethernet

Operation: value 1 for request and value 2 for response

Page 85: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Address Resolution ProtocolAddress 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)

Page 86: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Internet Control Message Protocol

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.

Page 87: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Internet Control Message Protocol

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 t

hat 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)

Page 88: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Internet Control Message Protocol

Internet Control Message Protocol

Applications of ICMP Test the reachability: the “ping” program uses t

he “echo request” and “echo reply” messages. Trace route: the “traceroute” message may set t

he TTL field for route tracing. MTU discovery: to find the MTU of a route by

sending various-size packets with DM=1

Page 89: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Transport Layer ProtocolsTransport Layer Protocols

IP

TCP UDP

NetworkLayer

TransportLayer

Page 90: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCPTCP

Source Port Destination Port

Sequence Number

Acknowledgement Number

THL Reserved Flags Window

Checksum Urgent Pointer

Page 91: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

UDPUDP

Source Port Destination Port

Length Checksum

Data

Page 92: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP/UDPTCP/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 TSA

P (Transport Service Access Point) Sequence number (TCP): specify the sequence of t

he current datagram Acknowledgement number (TCP): specify the “ex

pected” number of datagram to be received UDP length: the length of the UDP datagram (incl

uding the 8-byte UDP header)

Page 93: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Flags in TCP HeaderFlags 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.

Page 94: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Some TCP/UDP Port NumbersSome TCP/UDP Port Numbers

ftp-data 20

telnet 23

smtp 25

login 49

www-http 80

DNS 53

BGP 179

SNMP 161………….. ………... ……….

Page 95: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCPTCP

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

Page 96: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP Connection EstablishmentTCP Connection Establishment

S R

SYN(SEQ=x)

SYN(SEQ=y, ACK=x+1)

(SEQ=x+1, ACK=y+1)

SYN(SEQ=x)

SYN(SEQ=y)

SYN(SEQ=y, ACK=x+1)

SYN(SEQ=x, ACK=y+1)

S/R S/R

(SEQ=x+1, ACK=y+1)Three-wayHandshake

Page 97: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP ConnectionTCP Connection

SYN Packet

SYN/Ack

AckEstablishment

Data Transfer

FIN

FIN/Ack

Ack

Release

Sequence/AckNumber

Page 98: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Retransmission in TCPRetransmission in TCP

Page 99: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP Congestion/Flow ControlTCP 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

Page 100: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP Flow ControlTCP Flow Control

Functions 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

Page 101: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Transmission Delay v.s. Window 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.

Page 102: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP Congestion/Flow ControlTCP 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.

Page 103: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP Congestion/Flow ControlTCP 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.

Page 104: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP Congestion/Flow ControlTCP Congestion/Flow Control

Page 105: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP Congestion/Flow ControlTCP Congestion/Flow Control

Long Round-Trip Time

LargerWindow

Size

More packetson the way

If networkCongested Packet loss

Page 106: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP Congestion/Flow ControlTCP Congestion/Flow Control

Dynamic window size adjustment in TCP The TCP connection transmits packet from slo

w 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

Page 107: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

TCP Congestion/Flow ControlTCP 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

Page 108: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Threats in TCP ProtocolsThreats 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.

Page 109: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Threats in TCP Protocols – SYN Flooding

Threats in TCP Protocols – SYN Flooding

Page 110: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Threats in TCP Protocols - Hijacking

Threats in TCP Protocols - Hijacking

Reject

ClientServer

Hacker

Disturb Sequence Number

Page 111: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

Future IP Network – IPv6 and QoS

Future IP Network – IPv6 and QoS

Page 112: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

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

Page 113: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

但是,您可知道 32 位元的 IPv4 位址有可能在 2005 年就用完了嗎 ?

!!!!!!IPv4

IPv6Total

Time

Vo

lum

e

2005!

您或許知道現在所用的 Internet

通信協定是 IPv4!

Page 114: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IPv6 v.s. IPv4IPv6 v.s. IPv4

IPv4 Header

minimum20 octets

Data Field

maximum65535 octets

IPv4 PDU

IPv6 Header

Fixed40 octets

Data Field

maximum65535 octets

IPv6 PDU

ExtensionHeader

ExtensionHeader

...

0 or more

Page 115: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IPv6 HeaderIPv6 Header

IPv6 Packet Header

32 bitsVer.

Pri-ority Flow Label

Payload Length Next Header Hop Limit

Source Address

Source Address

Source Address

Source Address

Destination Address

Destination Address

Destination Address

Destination Address

Page 116: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IPv6 v.s. IPv4 -- overviewIPv6 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

Page 117: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

IPv6 v.s. IPv4 -- overviewIPv6 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

Page 118: TCP/IP 陳彥文. YWChen-TCP/IP 何謂資料? IEEE 對 Data 的定義為 -- A representation of facts, concepts, or instructions in a formalized manner suitable for communication,

YWChen-TCP/IP

Internet QoS – The big pictureInternet 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