29
CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

Embed Size (px)

Citation preview

Page 1: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331:Introduction to Networksand Security

Lecture 10

Fall 2002

Page 2: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 2

Announcements

• HW 2 Graded– Mean 82– Pick up after class

Page 3: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 3

Recap

• Domain Name System• IPv4 Routing

– RIP – Routing Information Protocol– OSPF – Open Shortest Path First

Page 4: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 4

Today

• Interdomain Routing• IPv6• UDP & TCP

Page 5: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 5

Interdomain Routing

• EGP - Exterior Gateway Protocol– Early; constrained Internet to tree and hence

shares some problems of bridging (scalability, path exploitation, etc. ….. )

Internet tree structure circa 1990.

Page 6: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 6

Backbone Service Provider

Today’s Multibackbone Internet

Backbone Service ProviderBackbone Service

Provider

Consumer ISP Consumer ISP

Consumer ISP

Large Corporation

Large Corporation

Small Company

Peering point

Page 7: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 7

BGP - Border Gateway Protocol

• Arbitrary topology• Interconnected of Administrative Domains

– local traffic: originates or terminates in A.D.– transit traffic: passes through– stub: one A.D.-A.D. link– multihomed: multiple A.D. links, no transit– transit: connections to other A.D.s; carry transit

Page 8: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 8

BGP Continued

• AD Connectivity– A border gateway is an IP router that forwards

packets between A.D.s– A.D. has one “BGP speaker”

• Border Gateway Protocol– Advertises reachability, not costs– Advertises complete paths between A.D.s

• Needed for policy decisions like “Use provider B”• Helps detect loops

– Not LSP or DV.– Router state ~# A.D.s, hence large

Page 9: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 9

Next Generation IP (IPv6 or IPng)

• Lots of addresses (128 bits)• Real-time• Security• Autoconfiguration• Mobile hosts and other enhanced routing

functions

Page 10: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 10

Packet Format

Next Header/Data

Ver. Prio FlowLabel

PayloadLEN NextHeader HopLimit

Source Address (128 bits)

Destination Address (128 bits)

0 31

Page 11: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 11

Protocol Stack Revisited

Application

Presentation

Session

Transport

Network

Data Link

Physical

UDP and TCP/IP

So far…

Page 12: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 12

Application vs. Network

Application Needs Network Char.

Reliable, Ordered, Single-Copy Message Delivery

Drops , Duplicates and Reorders Messages

Arbitrarily large messages

Finite message size

Allows Flow Control by Receiver

Arbitrary Delay

Supports multiple applications per-host

Page 13: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 13

User Datagram Protocol (UDP)

• Simplest transport-layer protocol• Just exposes IP packet functionality to

application level• Ports identify sending/receiving process

– Demultiplexing information– (port, host) pair identifies a network process

SrcPort DestPort

Length Checksum

IP Packet Data

0 16 31

Page 14: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 14

UDP End-to-End Model

• Multiplexing/Demultiplexing with Port number

UDP Sender(Multiplexer)

UDP Receiver(Demultiplexer)

Application ApplicationApplication Application

Page 15: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 15

Using Ports

• Client contacts Server at a well-known port– DNS: port 53– POP3: port 110– Unix talk : port 517– In unix, ports are listed in /etc/services

• Sometimes Client and Server agree on a different port for subsequent communication

• Ports are an abstraction– Implemented differently on different OS’s– Typically a message queue

Page 16: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 16

Transmission Control Protocol (TCP)

• Most widely used protocol for reliable byte streams– Reliable, in-order delivery of a stream of bytes– Full duplex: pair of streams, one in each direction– Flow and congestion control mechanisms– Like UDP, supports ports

• Built on top of IP (hence TCP/IP)

Page 17: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 17

TCP End-to-End Model

• Buffering corrects errors but may introduce delays

Application ApplicationApplication Application

TCP Sender:Send Buffers

TCP ReceiverReceive Buffers

segment segmentsegment

segment

Page 18: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 18

Packet Format

• Flags– SYN– FIN– RESET– PUSH– URG– ACK

• Fields

SequenceNum

SrcPort DstPort

Options (variable)

Checksum UrgPtr

HL 0 Flags Advert.Wind.

Acknowledgment

0 15 31

DATA

Page 19: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 19

Three-Way Handshake

Page 20: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 20

TCP State Transitions

Page 21: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 21

TCP Receiver

• Maintains a buffer from which application reads

• Advertises < buffer size as the window for sliding window

• Responds with Acknowledge and AdvertisedWindow on each send; updates byte counts when data O.K.

• Application blocked until read() O.K.

Page 22: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 22

TCP Sender

• Maintains a buffer; sending application is blocked until room in the buffer for its write

• Holds data until acknowledged by receiver as successfully received

• Implement window expansion and contraction; note difference between flow and congestion control

Page 23: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 23

Flow vs. Congestion Control

• Flow control protects the recipient from being overwhelmed.

• Congestion control protects the network from being overwhelmed.

Page 24: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 24

TCP Congestion Control

• Additive Increase / Multiplicative Decrease• Slow Start• Fast Retransmit and Fast Recovery

Page 25: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 25

Increase and Decrease

• A value CongestionWindow is used to control the number of unacknowledged transmissions.

• This value is increased linearly until timeouts for ACKs are missed.

• When timeouts occur, CongestionWindow is decreased by half to reduce the pressure on the network quickly.

• The strategy is called “additive increase / multiplicative decrease”.

Page 26: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 26

Additive Increase

Page 27: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 27

TCP Sawtooth Pattern

Time

KB

Page 28: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 28

Slow Start

• Sending the entire window immediately could cause a traffic jam in the network.

• Begin “slowly” by setting the congestion window to one packet.

• When acknowledgements arrive, double the congestion window.

• Continue until ACKs do not arrive or flow control dominates.

Page 29: CSE331: Introduction to Networks and Security Lecture 10 Fall 2002

CSE331 Fall 2002 29

Slow Start