Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Networking TCP/IP Part 2

Similar presentations


Presentation on theme: "Computer Networking TCP/IP Part 2"— Presentation transcript:

1 Computer Networking TCP/IP Part 2
Dr Sandra I. Woolley

2 Contents TCP/IP Part 2 Transport Layer Protocols: UDP and TCP
Internet Routing Protocols: Interior Gateway Protocol (IGP) Exterior Gateway Protocol (EGP) Open Shortest Path First (OSPF) Border Gateway Protocol DHCP

3 Transport Layer Protocols: UDP and TCP

4 UDP – User Datagram Protocol
Best effort datagram service Simple transmitter and receiver Connectionless: no handshaking and no connection state Low header overhead No flow control, no error control, no congestion control UDP datagrams can be lost or out-of-order Applications multimedia (e.g. RTP) network services (e.g. DNS, SNMP)

5 UDP Datagram Source and destination port numbers
0-255 Well-known ports 256-1,023 Less well-known ports 1,024-65,536 Ephemeral client ports Source and destination port numbers Client ports are ephemeral Server ports are well-known Max number is 65,535 UDP length Total number of bytes in datagram (including header) 8 bytes ≤ length ≤ 65,535 UDP Checksum Optionally detects errors in UDP datagram (all 0's if not used) Source Port Destination Port UDP Length UDP Checksum Data

6 TCP – Transmission Control Protocol
Reliable byte-stream service More complex transmitter and receiver Connection-oriented: full-duplex unicast connection between client and server processes Connection setup, connection state, connection release Higher header overhead Error control, flow control, and congestion control Higher delay than UDP Most applications use TCP HTTP, SMTP, FTP, POP3, …

7 TCP Segment Format Source port Destination port Sequence number Acknowledgment number Checksum Urgent pointer Options Padding U R G A C K P S H T Y N F I Header length Reserved Window size Data Each TCP segment has header of 20 or more bytes + 0 or more bytes of data

8 TCP Header Port Numbers
A socket address identifies a connection endpoint IP address + port A connection is specified by a socket address pair. Well-known ports FTP 20 DNS 53 HTTP 80 Sequence Number Byte count First byte in segment. Initial sequence number is selected during connection setup.

9 Initial Sequence Number
Select initial sequence numbers (ISN) to avoid overlap with segments from prior connections that may circulate in the network and arrive at a later time.

10 TCP Connection Establishment
“Three-way Handshake” Initial sequence numbers (ISN) chosen to protect against segments from prior connections Host A Host B SYN, Seq_no = x SYN, Seq_no = y, ACK, Ack_no = x+1 Seq_no = x+1, ACK, Ack_no = y+1

11 If Host Always Uses the Same ISN
Host B SYN, Seq_no = n, ACK, Ack_no = n+1 Seq_no = n+1, ACK, Ack_no = n+1 Delayed segment with Seq_no = n+2 will be accepted

12 Maximum Segment Size Maximum Segment Size (MSS)
largest block of data that TCP sends to other end. Each end can announce its MSS during connection establishment. Default is 576 bytes including 20 bytes for IP header and 20 bytes for TCP header. Ethernet implies MSS of 1,460 bytes. IEEE implies 1,452

13 TCP Connection Closing
“Graceful Close” Acknowledge FIN statements FIN, seq = 5086 Ack = 5087 Data, seq. = 303, Ack=5087 Delivers data bytes FIN, seq. =453, Ack = 5087 Ack = 454 Host A Host B Ack = 453

14 Internet Routing Protocols

15 Routing and Forwarding
How to determine the routing table entries carried out by routing daemon Forwarding Look up routing table and forward packet from input to output port carried out by IP layer Routers exchange information using routing protocols to develop the routing tables.

16 Autonomous Systems Global Internet viewed as collection of autonomous systems. Autonomous system (AS) is a set of routers or networks administered by a single organization. Same routing protocol need not be run within the AS. But, to the outside world, an AS should present a consistent picture of what ASs are reachable through it. Stub AS: has only a single connection to the outside world. Multihomed AS: has multiple connections to the outside world, but refuses to carry transit traffic Transit AS: has multiple connections to the outside world, and can carry transit and local traffic.

17 Inter and Intra Domain Routing
Interior Gateway Protocol (IGP): routing within AS RIP, OSPF Exterior Gateway Protocol (EGP): routing between AS’s BGPv4 Border Gateways perform IGP & EGP routing IGP R EGP IGP R R R R R AS A AS C R R IGP AS B

18 Open Shortest Path First (OSPF)
RFC 2328 (v2) Enables each router to learn complete network topology. Each router monitors the link state to each neighbour and floods the link-state information to other routers. Each router builds an identical link-state database. Allows router to build shortest path tree with itself as root. OSPF typically converges fast when there is a failure in the network. To improve scalability, AS may be partitioned into areas Area is identified by 32-bit Area ID Router in area only knows complete topology inside area and limits the flooding of link-state information to area. Area border routers summarize info from other areas.

19 OSPF Protocol OSPF packets transmitted directly on IP datagrams; Protocol ID 89 Five OSPF packet types: Hello Database description Link state request; Link state update; Link state ack OSPF Stages Discover neighbours by sending Hello packets (every 10 sec) and designated router elected in multi-access networks. Adjacencies are established and link state databases are synchronized. Link state information is propagated (and updated every 30 mins) & routing tables are calculated.

20 Exterior Gateway Protocols
The Internet is woven into a coherent whole by Exterior Gateway Protocols (EGPs) that operate between AS’s. EGP enables two AS’s to exchange routing information about: The networks that are contained within each AS. The AS’s that can be reached through each AS. EGP path selection is guided by policy rather than path optimality Trust, peering arrangements, etc.

21 EGP Example AS1 AS2 AS3 R1 R2 R3 R4 N1
EGP routers within an AS, e.g. R3 and R2, are kept consistent. Suppose AS2 is willing to handle transit packets from AS1 to N1. R2 advertises to AS1 the reachability of N1 through AS2. R1 applies its policy to decide whether to send to N1 via AS2. N1 reachable through AS2

22 Border Gateway Protocol v4
BGP (RFC 1771) is an EGP “routing” protocol to exchange network reachability information among BGP routers (also called BGP speakers.) Network reachability information contains sequence of ASs that packets traverse to reach a destination network. Information exchanged between BGP speakers allows a router to construct a graph of AS connectivity Routing loops can be pruned Routing policy at AS level can be applied AS1 AS2 AS3 AS4 AS5 AS6 AS7

23 BGP Speaker & AS Relationship
BGP speaker: a router running BGP Peers or neighbours: two speakers exchanging information on a connection. BGP peers use TCP (port 179) to exchange messages. Initially, BGP peers exchange entire BGP routing table Incremental updates sent subsequently Reduces bandwidth usage and processing overhead Keepalive messages sent periodically (30 seconds) Internal BGP (iBPG) between BGP routers in same AS. External BGP (eBGP) connections across AS borders.

24 iBGP & eBGP R iBGP eBGP eBGP to exchange reachability information in different AS’s eBGP peers directly connected iBGP to ensure net reachability information is consistent among the BGP speakers in the same AS

25 Path Selection Each BGP speaker
Evaluates paths to a destination from an AS border router Selects the best path that complies with policies Advertises that route to all BGP neighbours BGP assigns a preference order to each path and selects path with highest value; BGP does not keep a cost metric to any path. When multiple paths to a destination exist, BGP maintains all of the paths, but only advertises the one with highest preference value.

26 BGP Policy Examples of policy: Never use AS X.
Never use AS X to get to a destination in AS Y. Never use AS X and AS Y in the same path. Import policies to accept, deny, or set preferences on route advertisements from neighbours. Export policies to determine which routes should be advertised to which neighbours. A route is advertised only if AS is willing to carry traffic on that route.

27 Additional Notes

28 Additional Notes Dynamic Host Configuration Protocol – protocol for assigning IP addresses. Queueing (bookwork basics – what is Little’s formula?) Quality-of-Service.

29 Thank You


Download ppt "Computer Networking TCP/IP Part 2"

Similar presentations


Ads by Google