44
Chapter 10 Chapter 10 Routing Algorithm Routing Algorithm , Congestion , QOS , Congestion , QOS

Chapter 10 Routing Algorithm , Congestion , QOS

Embed Size (px)

DESCRIPTION

Chapter 10 Routing Algorithm , Congestion , QOS. Network Layer Design Issues. การสลับเส้นทางเดิน แพ็กเกต ด้วยวิธีจัดเก็บและส่งต่อ (Store-and-Forward Packet Switching) การบริการให้กับชั้นสื่อสารนำส่งข้อมูล (Services Provided to the Transport Layer) - PowerPoint PPT Presentation

Citation preview

Chapter 10Chapter 10

Routing Algorithm Routing Algorithm , Congestion , QOS , Congestion , QOS

2

Network Layer Design Network Layer Design IssuesIssues

• การสลั�บเสนทางเดิ�นแพ็�กเกตดิวยว�ธี�จั�ดิเก�บแลัะส�งต�อ (Store-and-Forward Packet Switching)

• การบร�การให้ก�บชั้��นส� อสารน!าส�งข้อมู$ลั (Services Provided to the Transport Layer)

• การให้บร�การบนระบบส� อสารแบบไมู�มู�การเชั้� อมูต�อ (Implementation of Connectionless Service)

• การให้บร�การบนระบบส� อสารแบบมู�การเชั้� อมูต�อ (Implementation of Connection-Oriented Service)

• การเปร�ยบเท�ยบระห้ว�างวงจัรเสมู�อนแลัะดิาตาแกรมู (Comparison of Virtual-Circuit and Datagram Subnets)

3

Store-and-Forward Packet Store-and-Forward Packet SwitchingSwitching

The environment of the network layer protocols.

แพ็�กเกตจะถูกจ�ดเก�บไว้�จนกว้�าข้�อมูลทั้��งแพ็�กเกตจะเด�นทั้างมูาถู�งอย่�างครบถู�ว้น

Router จะทั้!าการตรว้จสอบคว้ามูถูกต�องข้องข้�อมูลก�อนส�งต�อให้� router ต�ว้ต�อไป

4

Services Provided to the Services Provided to the Transport LayerTransport Layer

ว้�ตถู&ประสงค'ในการออกแบบบร�การในชั้��นคว้บค&มูเคร)อข้�าย่

บร�การทั้*+มู*ให้�แก�ชั้� �นน!าส�งข้�อมูลต�องเป,นอ�สระจากเทั้คโนโลย่*ทั้*+ใชั้�ในการค�นห้าเส�นทั้างเด�นข้�อมูล

ชั้��นน!าส�งข้�อมูลจะต�องไมู�ไปเก*+ย่ว้ข้�องก�บโครงสร�างข้องเส�นทั้างเด�นข้�อมูล

ว้�ธี*การก!าห้นดทั้*+อย่�ในเคร)อข้�าย่ทั้*+ส�งให้�ชั้� �นน!าส�งข้�อมูลจะต�องอย่�ในรปแบบมูาตรฐานทั้*+เป,นทั้*+เข้�าใจได�แมู�ในระบบต�างแบบก�น

5

Connectionless and Connection-Connectionless and Connection-oriented Servicesoriented Services

บร�การท� มู�ให้ในชั้��นควบค(มูเคร�อข้�ายมู� 2 แบบ◦Connectionless Service

•แพ็�กเกตถูกจ�ดเส�นทั้างอย่�างอ�สระจากแพ็�กเกตอ)+นๆ•แพ็�กเก�ตด�งกล�าว้เร*ย่กว้�า Datagram •ระบบเคร)อข้�าย่ย่�อย่เร*ย่กว้�า datagram subnet

◦Connection-oriented Service• เส�นทั้างเด�นข้�อมูลจาก router ต�นทั้างไปย่�ง

router ปลาย่ทั้างต�องถูกก!าห้นดข้��นก�อน•การเชั้)+อมูต�อแบบน*�เร*ย่กว้�าว้งจรเสมู)อน (virtual circuit)

•ระบบเคร)อข้�าย่ย่�อย่เร*ย่กว้�า virtual circuit subnet

6

Implementation of Implementation of Connectionless ServiceConnectionless Service

Routing within a diagram subnet.

7

Implementation of Connection-Implementation of Connection-Oriented ServiceOriented Service

Routing within a virtual-circuit subnet.

8

Routing AlgorithmsRouting Algorithms• The Optimality Principle• Shortest Path Routing• Flooding• Distance Vector Routing• Link State Routing• Hierarchical Routing• Broadcast Routing• Multicast Routing• Routing for Mobile Hosts• Routing in Ad Hoc Networks

9

Routing Algorithms (2)Routing Algorithms (2)

Conflict between fairness and optimality.

ถู�าปร�มูาณข้�อมูลทั้*+ไห้ลจาก A ไป A’ จาก B ไป B’ และจาก C ไป C’ มูากพ็อทั้*+จะทั้!าให้�การส�งข้�อมูลทั้างแนว้ราบอ�+มูต�ว้ ถู�าต�องการให้�ระบบน*�มู*ประส�ทั้ธี�ภาพ็โดย่รว้มูสงส&ดแล�ว้ การส)+อสารระห้ว้�าง X และ X’ คว้รจะต�องถูกระง�บไว้�ก�อน

10

The Optimality PrincipleThe Optimality Principle

(a) A subnet. (b) A sink tree for router B.

ถู�า router ห้น�+ง (จ&ด B) อย่�บนเส�นทั้างทั้*+เห้มูาะสมูทั้*+ส&ดระห้ว้�างผู้�ส�ง (จ&ด A) และผู้�ร �บข้�อมูล (จ&ด C) แล�ว้ เส�นทั้างน��นจะเป,นเส�นทั้างทั้*+เห้มูาะสมูทั้*+ส&ดระห้ว้�าง router น��น (จ&ด B) ก�บผู้�ร �บข้�อมูล (จ&ด C) ด�ว้ย่

11

Shortest Path RoutingShortest Path Routing

The first 5 steps used in computing the shortest path from A to D. The arrows indicate the working node.

Dijkstra (1959) ได�น!าเสนอ algorithm ส!าห้ร�บการค�นห้าเส�นทั้างทั้*+ส� �นทั้*+ส&ดระห้ว้�างจ&ด 2 จ&ด

12

FloodingFloodingเป,นว้�ธี*การทั้*+ไมู�ปร�บต�ว้เข้�าก�บสภาพ็แว้ดล�อมูข้องระบบRouter จะส�งแพ็�กเกตทั้*+ร �บเข้�ามูาออกไปทั้&กทั้�ศทั้างทั้*+มู*

การเชั้)+อมูต�อก�บ router ย่กเว้�น router ทั้*+เป,นผู้�ส�งเข้�ามูา

ว้�ธี*น*�จะเพ็�+มูปร�มูาณข้�อมูลในเคร)อข้�าย่เข้�ามูาอย่�างมูากมูาย่ซึ่�+งส�ว้นมูากจะเป,นข้�อมูลทั้*+ซึ่!�าก�น

ต�องมู*กรรมูว้�ธี*อ)+นเข้�าชั้�ว้ย่เพ็)+อไมู�ให้�เก�ดข้�อมูลมูห้าศาลในเคร)อข้�าย่• การใส�ต�ว้เลข้น�บจ!านว้น router เข้�าไปในข้�อมูลส�ว้นห้�ว้• การจ�ดทั้!าบ�นทั้�กแพ็�กเกตทั้*+ได�ส�งออกไปแล�ว้เพ็)+อทั้*+จะได�ไมู�ต�อง

ส�งออกไปอ*ก

13

Distance Vector RoutingDistance Vector Routingเป*น algorithm เลั�อกเสนทางแบบ dynamic Router ตองสรางตารางเก�บข้อมู$ลัซึ่, งบอกระยะ

ทางแลัะเสนทางท� ดิ�ท� ส(ดิในการส�งแพ็�กเกตไปย�ง router ต�างๆ

มู�การปร�บปร(งข้อมู$ลัในตารางอย$�เสมูอโดิยแลักเปลั� ยนข้�าวสารก�นระห้ว�าง router ท� อย$�ต�ดิก�น

มูาตรว�ดิท� ใชั้ไดิแก� จั!านวน router ในเสนทาง เวลัารอคอยตลัอดิเสนทาง จั!านวนแพ็�กเกตท� รอการน!าส�ง เป*นตน

14

Distance Vector RoutingDistance Vector Routing

(a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.

ถ้า Router J ตองการค!านวนเวลัาส�งข้อมู$ลัไปย�ง Router G: 1) ส�งข้อมู$ลัผ่�าน Router Aใชั้เวลัา 8 มู�ลัลั�ว�นาท� 2) จัาก A ไปย�ง G ใชั้เวลัา 18 มู�ลัลั�ว�นาท� เวลัารวมู = 8+18=28 มู�ลัลั�ว�นาท� ในท!านองเดิ�ยวก�น ถ้าส�งผ่�าน I, H, แลัะ K จัะใชั้เวลัารวมู (10+31=41), (12+6=18), แลัะ (6+31=37) ตามูลั!าดิ�บ เวลัาท� ดิ�ท� ส(ดิค�อ18 ดิ�งน��น J บ�นท,กเวลัา18 ผ่�าน H

15

Link State RoutingLink State Routing เป,น algorithm แบบ dynamic เห้มูาะส!าห้ร�บ

สาย่ส�งทั้*+มู*คว้ามูเร�ว้สง แต�ละ Router ต�องต�องทั้!าส�+งต�อไปน*�

•ทั้!าคว้ามูร �จ�กก�บ Router ข้�างเค*ย่งและเร*ย่นร �ทั้*+อย่�บนเคร)อข้�าย่ข้อง Router เห้ล�าน��น

•ค!านว้ณระย่ะเว้ลารอคอย่ห้ร)อ cost ในการต�ดต�อก�บ router ข้�างเค*ย่ง

•สร�างแพ็�กเกตส!าห้ร�บส�งข้�อมูลทั้*+ตนเองรว้บรว้มูมูาได�•ส�งแพ็�กเกตไปย่�ง router ทั้&กต�ว้•ค!านว้ณระย่ะทั้างทั้*+ส� �นทั้*+ส&ดส!าห้ร�บการต�ดต�อไปย่�ง

แต�ละ router

16

Hierarchical RoutingHierarchical Routingผู้ลทั้*+ตามูมูาจากการทั้*+เคร)อข้�าย่มู*จ!านว้น router

มูากข้��นเร)+อย่ค)อเป,น algorithm ทั้*+แบ�ง router ในระบบออก

เป,นกล&�มูเล�กๆเร*ย่กว้�า regionRouter ใน region เด*ย่ว้ก�นทั้ราบเส�นทั้างทั้*+จะส�ง

ข้�อมูลถู�งก�น แต�ไมู�มู*ข้�อมูลเก*+ย่ว้ก�บ router ใน region อ)+น

17

Hierarchical RoutingHierarchical Routingต�วอย�างการจั�ดิแบ�งกลั(�มูข้อมู$ลัออกเป*น 2 ระดิ�บ ประกอบดิวย 5 region: การจั�ดิแบบเดิ�มู router 1A ตองมู�ข้อมู$ลัถ้,ง 17 รายการ เมู� อจั�ดิแบบ 2 ระดิ�บ router 1A จัะมู�รายการเห้ลั�อเพ็�ยง 7 รายการ ดิ�งน��นเมู� อจั!านวน router เพ็� มูมูากข้,�นเท�าใดิ ว�ธี�การน��จัะชั้�วยลัดิจั!านวนรายการในตารางข้อมู$ลัไดิมูากย� งข้,�น

Hierarchical routing.

18

Broadcast RoutingBroadcast Routingตองการให้ Host สามูารถ้ส�งข้�าวสารชั้(ดิเดิ�ยวก�นไปย�ง Host อ� นๆไดิห้ลัายต�วห้ร�อท(กต�วในระบบ ส�งข้อมู$ลัโดิยตรง

• สร�างแพ็�กเกตข้��นมูาเทั้�าก�บจ!านว้น node ทั้��งห้มูดในเคร)อข้�าย่• แต�ละแพ็�กเกตระบ&แอดเดรสข้องแต�ละ node

ส�งโดิยว�ธี�การ Flooding - มู*การส!าเนาข้�อมูลจ!านว้นมูาก ทั้!าให้�ประส�ทั้ธี�ภาพ็โดย่รว้มูข้องระบบลดลง

ส�งแบบ Multi-destination routing• แต�ละแพ็�กเกตบรรจ&ราย่การทั้*+อย่�ข้องจ&ดห้มูาย่ปลาย่ทั้างทั้*+ต�องการ

ทั้��งห้มูด• router ตรว้จสอบราย่การข้องผู้�ร �บทั้��งห้มูดเพ็)+อเล)อกสาย่ส)+สารทั้*+ต�อง

ใชั้�แล�ว้ส!าเนาแพ็�กเกตให้�เทั้�าก�บจ!านว้นสาย่ส)+อสารทั้*+เล)อกไว้�แล�ว้ปร�บปร&งราย่การทั้*+อย่�ข้องผู้�ร �บข้องแต�ละแพ็�กเกตให้�ถูกต�อง

• ห้ล�งจากกระจาย่ไปส�กพ็�ก แพ็�กเกตทั้*+ย่�งไมู�ถู�งผู้�ร �บจะเป,นแพ็�กเกตรรมูดาค)อมู*ผู้�ร �บเพ็*ย่ง node เด*ย่ว้

น!าห้ลั�กการข้อง sink tree แลัะ spanning tree มูาใชั้

19

Broadcast RoutingBroadcast Routing

Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The tree built by reverse path forwarding.

20

Multicast RoutingMulticast Routing

จ�ดต��งกล&�มู – สร�าง ทั้!าลาย่ เข้�าร�ว้มูเป,นสมูาชั้�ก ลาออกจากกล&�มู เพ็)+อใชั้�เป,นข้�อมูลส!าห้ร�บห้าเส�นทั้าง

Router แต�ละต�ว้สร�าง spanning tree ข้องตนเอง

เมู)+อ process ทั้!าการแพ็ร�กระจาย่ packet ข้�าว้สารออกไปย่�งกล&�มูข้องตน router ต�ว้แรกทั้*+ร �บแพ็�กเกตได�จะเป,นต�ว้ตรว้จสอบ spanning tree อย่�างทั้�+ว้ถู�ง เส�นทั้างใดไมู�สามูารถูต�ดต�อก�บ host ทั้*+เป,นสามูาชั้�กกล&�มูได� ก�ต�ดทั้��งออกไป

21

Multicast RoutingMulticast Routing

(a) A network. (b) A spanning tree for the leftmost router. (c) A multicast tree for group 1. (d) A multicast tree for group 2.

22

Congestion Control Congestion Control

23

Congestion Control Congestion Control AlgorithmsAlgorithms• General Principles of Congestion Control• Congestion Prevention Policies• Congestion Control in Virtual-Circuit

Subnets• Congestion Control in Datagram Subnets• Load Shedding• Jitter Control

24

CongestionCongestion

When too much traffic is offered, congestion sets in and performance degrades sharply.

25

General Principles of Congestion General Principles of Congestion ControlControl

คอยจั�บตาดิ$ระบบ เพ็� อคนห้าส�วนท� เก�ดิป1ญห้าความูค�บค� งข้องข้อมู$ลั

ส�งข้�าวสารน��ไปบอกห้น�วยท� ร�บผ่�ดิชั้อบการแกป1ญห้าปร�บการท!างานข้องระบบเพ็� อแกป1ญห้าท� เก�ดิข้,�น

26

Policies that affect Policies that affect congestioncongestion

5-26

27

Congestion Control in Virtual-Circuit Congestion Control in Virtual-Circuit SubnetsSubnets

(a) A congested subnet. (b) A redrawn subnet, eliminates congestion and a virtual circuit from A to B.

28

Hop-by-Hop Hop-by-Hop Choke Choke PacketsPackets

(a) A choke packet that affects only the source.

(b) A choke packet that affects each hop it passes through.

29

Jitter ControlJitter Control

(a) High jitter. (b) Low jitter.

Jitter: delay of packet delivery

30

Quality of ServiceQuality of Service

31

Quality of ServiceQuality of Service

• คว้ามูต�องการ (Requirements)• เทั้คน�คเพ็)+อให้�ได�ค&ณภาพ็การให้�บร�การสง

(Techniques for Achieving Good Quality of Service)

• การให้�บร�การแบบรว้มูการ (Integrated Services)

• การให้�บร�การแย่กเฉพ็าะ (Differentiated Services)

• Label Switching and MPLS

32

RequirementsRequirements

How stringent the quality-of-service requirements are.

5-30

33

BufferingBuffering

การท!าให้การน!าส�งแพ็�กเกตราบร� นดิวยการใชั้ Buffer

34

The Leaky Bucket AlgorithmThe Leaky Bucket Algorithm

(a) A leaky bucket with water. (b) a leaky bucket with packets.

อ�ลักอร�ธี,มูถ้�งน!�าร� ว

35

The Token Bucket The Token Bucket AlgorithmAlgorithm

(a) Before. (b) After.

5-34

36

Admission ControlAdmission Control

An example of flow specification.

5-34

37

Packet SchedulingPacket Scheduling

(a) A router with five packets queued for line O.(b) Finishing times for the five packets.

38

Integrated ServicesIntegrated Servicesสถูาป7ย่กรมูส!าห้ร�บกระแสข้�อมูลมู�ลต�มู*เด*ย่Flow-based algorithmใชั้�ก�บงานประย่&กต'ทั้��งประเภทั้ unicast และ

MulticastResource reServation Protocol

(RSVP)• พ็�ฒนาโดย่ Zhang et al., 1993• ผู้�ส�งห้ลาย่คนสามูารถูกระจาย่ข้�อมูลไปย่�งผู้�ร �บห้ลาย่กล&�มูได�• ผู้�ร �บแต�ละคนสามูารถูเปล*+ย่นไปร�บข้�าว้สารจากผู้�ส�งคนใด

ก�ได�เมู)+อต�องการ• บร�ห้ารการใชั้�ชั้�ว้งส�ญญาณส)+อสารอย่�างมู*ประส�ทั้ธี�ภาพ็ใน

ข้ณะทั้*+พ็ย่าย่ามูก!าจ�ดป7ญห้าคว้ามูค�บค�+งข้องข้�อมูล

39

RSVP-The ReSerVation RSVP-The ReSerVation ProtocolProtocol

(a) A network, (b) The multicast spanning tree for host 1. (c) The multicast spanning tree for host 2.

40

RSVP-The ReSerVation Protocol RSVP-The ReSerVation Protocol (2)(2)

(a) Host 3 requests a channel to host 1. (b) Host 3 then requests a second channel, to host 2. (c) Host 5 requests a channel to host 1.

41

Expedited ForwardingExpedited Forwarding

Expedited packets experience a traffic-free network.

การจ�ดส�งข้�อมูลเร�งด�ว้น (มูาตรฐาน RFC 3246) ก!าห้นดโดย่ IETF

42

Assured ForwardingAssured Forwarding

A possible implementation of the data flow for assured forwarding.

43

Label Switching and MPLSLabel Switching and MPLS

Transmitting a TCP segment using IP, MPLS, and PPP.

พ็�ฒนาโดย่กล&�มูผู้�ผู้ล�ต router โดย่เพ็�+มูป:าย่ชั้)+อห้ร)อ label เข้�าไปทั้*+ส�ว้นห้น�าข้องแพ็�กเกตและจ�ดการค�นห้าเส�นทั้างเด�นข้องข้�อมูลโดย่ใชั้�ข้�อมูลจาก label แทั้นทั้*+จะเป,นห้มูาย่เลข้ทั้*+อย่�ข้องผู้�ร �บ เทั้คน�คน*�สามูารถูค�นห้าเส�นทั้างได�อย่�างรว้ดเร�ว้และสามูารถูจ�ดส!ารองทั้ร�พ็ย่ากรทั้*+ต�องการไว้�ให้�ได�ตลอดเส�นทั้างทั้*+น!าส�งข้�อมูล

จบบทั้

4

4