Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 145A Case Study: Simplified BGP Finite State Machine Netlab.caltech.edu/course.

Similar presentations


Presentation on theme: "CS 145A Case Study: Simplified BGP Finite State Machine Netlab.caltech.edu/course."— Presentation transcript:

1

2 CS 145A Case Study: Simplified BGP Finite State Machine Netlab.caltech.edu/course

3 Today Brief Introduction of routing protocols Brief Introduction of routing protocols An example of Finite State Machine An example of Finite State Machine Lab 3 Lab 3

4 What does the Internet look like? Example: (/sbin/traceroute) Example: (/sbin/traceroute) C:\>tracert cwis.usc.edu Tracing route to cwis.usc.edu [128.125.253.146] 1 <1 ms Jorgensen-RSM-44.caltech.edu [131.215.44.253] 2 <1 ms Booth-border.ilan.caltech.edu [131.215.254.254] 3 <1 ms CalREN-Caltech.caltech.edu [192.41.208.49] 4 <1 ms JPL--CIT.POS.calren2.net [198.32.248.5] 5 1 ms UCLA--JPL.POS.calren2.net [198.32.248.1] 6 1 ms ISI--UCLA.POS.calren2.net [198.32.248.29] 7 2 ms USC--ISI.POS.calren2.net [198.32.248.25] 8 3 ms rtr43-c2-gw.usc.edu [128.125.251.66] 9 2 ms rtr-gw-1.usc.edu [128.125.254.1] 10 2 ms cwis.usc.edu [128.125.253.146]

5 Topology of the Network

6 The Journey of a packet (1) 131.215.44.214->131.215.44.253

7 The Journey of a packet (2) 131.215.44.253 IP MAC Physic Get a packet From Ethernet It ’ s for 00:90:6D:E7:D4:00. That ’ s me. I should accept it.

8 The Journey of a packet (2) 131.215.44.253 IP MAC “ OK, I am 00:90:6D:E7:D4:00 ” Pass the packet to IP Physic Get a packet from ethernet for : 00:90:6D:E7:D4:00

9 The Journey of a packet (2) 131.215.44.253 IP [IP] Header: From 131.215.44.214 to “ 128.125.253.146 ” “ Should go to next router: 131.215.254.254 ” MAC “ OK, I am 00:90:6D:E7:D4:00 ” Pass the packet to IP Physic Get a packet from ethernet for: 00:90:6D:E7:D4:00

10 Necessary Information (1) Where shall I pass the packet, for a given destination IP address? – Routing Table Where shall I pass the packet, for a given destination IP address? – Routing Table Exmaple: Exmaple: [weixl@orchestra:~]> route DestinationGatewayGen-maskFlagsInterface 131.215.44.0*255.255.255.0UEth0 127.0.0.0*255.0.0.0Ulo default131.215.44.2540.0.0.0UFEth0

11 How can the routers know the routing information?

12 How? Manually add/delete routing entries Manually add/delete routing entries Automatically exchange routing information between routers. Automatically exchange routing information between routers.

13 Routing Protocol A: hi, are you there? B: yes. A: Can I tell you a piece of news? B: Sure. A: I have a way to get to www.usc.edu. B: ok. I will send you all the packets that are going to www.usc.edu. … B: Hi, Can I tell you some news, too? A: Yes! B: I can connect to all the machines in “ cs.caltech.edu ” A: ok. I will send you all the packets that are going to “ cs.caltech.edu ”. ……

14 Routing Protocol A to C: hi, are you there?... … A to B: I think C is down. And from now on, I cannot contact USC. B: OK. I will try other paths when I get packets for USC. …

15 Routing Protocol Good: Efficiently broadcast up-to-date routing information Good: Efficiently broadcast up-to-date routing information Bad: Rumor may be broadcast efficiently, too. Bad: Rumor may be broadcast efficiently, too. Argument: If the majority is good … Argument: If the majority is good … The algorithm should be correct in distributed environments. The algorithm should be correct in distributed environments.

16 Routing Protocols Autonomous System Autonomous System

17 Routing Protocols Inside Autonomous System: Embrace the Freedom! Inside Autonomous System: Embrace the Freedom! RIP (Routing Information Protocol) RIP (Routing Information Protocol) OSPF (Open Shortest Path First) OSPF (Open Shortest Path First) Between Autonomous System (Exterior Gateway Protocol): More consideration … Between Autonomous System (Exterior Gateway Protocol): More consideration … BGP (Border Gateway Protocol) BGP (Border Gateway Protocol)

18 Border Gateway Protocol-4 Inter-Autonomous System Communication Inter-Autonomous System Communication Propagate Path Information Propagate Path Information Support Policy Support Policy Incremental Updates Incremental Updates Assume reliable transmission (TCP) Assume reliable transmission (TCP) http://www.ietf.org/rfc/rfc1771.txt http://www.ietf.org/rfc/rfc1771.txt http://www.ietf.org/rfc/rfc1771.txt

19 Simplified BGP State Machine

20 BGP Packets Packets Format: Packets Format: 0 - 15 th Byte: FF (hexadecimal) 0 - 15 th Byte: FF (hexadecimal) 16-17 th Byte: Unsigned number, Length of the Packet (>=19) 16-17 th Byte: Unsigned number, Length of the Packet (>=19) 18 th Byte: Packet Type: 18 th Byte: Packet Type: 1OPEN 1OPEN 2UPDATE 2UPDATE 3NOTIFICATION 3NOTIFICATION 4KEEPALIVE 4KEEPALIVE 19 th Byte to the end of the Packet: Routing Data 19 th Byte to the end of the Packet: Routing Data

21 Detailed Specification http://www.ietf.org/rfc/rfc1771.txt Appendix I (page 47) http://www.ietf.org/rfc/rfc1771.txt Appendix I (page 47) http://www.ietf.org/rfc/rfc1771.txt

22 Lab 3

23 Lab 3 - Task Implement a (simplified) simplified BGP Finite State Machine: Implement a (simplified) simplified BGP Finite State Machine: Ignore the timers Ignore the timers Ignore the details of Routing Data Ignore the details of Routing Data

24 Lab3 - Finite State Machine

25 Lab 3 - Requirements  The implementation is based on TCP.  The implementation is able to actively connect to multiple machines and it is able to accept requests from multiple machines.  The implementation allows at most one connection from one machine (identified by IP / hostname).  For each connection, the implementation implements the Lab3 Finite State Machine.

26 Lab 3 - Details A program “ server ” A program “ server ” Read from a file called “ server.conf ”. Format of “ server.conf ” : Read from a file called “ server.conf ”. Format of “ server.conf ” : (1 st line:) Listen_Port Connection_Num(N) (1 st line:) Listen_Port Connection_Num(N) (2 nd line:) IP_1 Port_1 (2 nd line:) IP_1 Port_1 ( … ) ( … ) (N+1 st line:) IP_N Port_N (N+1 st line:) IP_N Port_N The server should read from “ server.conf ”, listen to Listen_Port for new connection, at the same time, actively connect the specified machines (IP_1:Port_1, IP_2:Port_2, … IP_N:Port_N) The server should read from “ server.conf ”, listen to Listen_Port for new connection, at the same time, actively connect the specified machines (IP_1:Port_1, IP_2:Port_2, … IP_N:Port_N)

27 Lab 3 - Possible Problems Implementation of Finite State Machine Implementation of Finite State Machine Check the errors (including operation errors and Packet errors) Check the errors (including operation errors and Packet errors) Multiple connections from the same machine Multiple connections from the same machine

28 Lab 3 - Tips Re-Use the codes in Lab 1 Re-Use the codes in Lab 1 How to implement the Finite State Machine? How to implement the Finite State Machine? “ if … then …” “ if … then …” “ State transition table ” “ State transition table ” How to test? How to test? Incremental Development Incremental Development DON ’ T START AT THE LAST MOMENT! DON ’ T START AT THE LAST MOMENT!

29 Lab 3 Due: Dec 1 st (Sunday) 23:59:59 Due: Dec 1 st (Sunday) 23:59:59 Email: weixl@caltech.edu Email: weixl@caltech.eduweixl@caltech.edu Grading Grading TA hours: TA hours: Tue / Thu (20:00 – 22:00) JRG 170 Except: Nov.19 / Nov.21


Download ppt "CS 145A Case Study: Simplified BGP Finite State Machine Netlab.caltech.edu/course."

Similar presentations


Ads by Google