Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 9 Introduction to Networks and the Internet.

Similar presentations


Presentation on theme: "CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 9 Introduction to Networks and the Internet."— Presentation transcript:

1 CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 9 Introduction to Networks and the Internet

2 CMPE 80N - Introduction to Networks and the Internet 2 Announcements Quiz #3 on 06.03. Internet History video on Thu, 05.29. Project 2 due on 06.05 (by midnight). –Look at the instructions on Project 2’s Web page. Final exam on 06.09 from 7:30-10:30pm. –Comprehensive. –Location: BE 152 and BE 165 (overflow room).

3 CMPE 80N - Introduction to Networks and the Internet 3 Today TCP (cont’d). UDP.

4 CMPE 80N - Introduction to Networks and the Internet 4 Flow Control Flow control is necessary so that source doesn’t transmit too fast for given receiver. –E.g., a fast server trying to send 1Gb/s data to a small PC. –Without some form of control, some data will get lost.

5 CMPE 80N - Introduction to Networks and the Internet 5 TCP Flow Control Sliding window. –Receiver’s advertised window. Size of advertised window related to receiver’s buffer space. Sender can send data up to receiver’s advertised window.

6 CMPE 80N - Introduction to Networks and the Internet 6 TCP Sliding Window

7 CMPE 80N - Introduction to Networks and the Internet 7 TCP Flow Control: Example 2K;SEQ=0 ACK=2048; WIN=2048 2K; SEQ=2048 ACK=4096; WIN=0 ACK=4096; WIN=2048 1K; SEQ=4096 App. writes 2K of data 4K 2K 0 App. reads 2K of data 2K 1K App. does 3K write Sender blocked Sender may send up to 2K

8 CMPE 80N - Introduction to Networks and the Internet 8 Circuit- versus Packet Switching

9 CMPE 80N - Introduction to Networks and the Internet 9 Circuit Switching Old telephone technology. For each connection, switches establish physical “circuit”.

10 CMPE 80N - Introduction to Networks and the Internet 10 Circuit Switching - Example Physical copper connection set up when call is made Switching offices Switch

11 CMPE 80N - Introduction to Networks and the Internet 11 Circuit Switching (cont’d) Switches are set up at the beginning of the connection and maintained throughout the connection. Network resources reserved and dedicated from sender to receiver. Not a very efficient strategy. –A connection “holds” a physical line even during “silence” periods (when there is nothing to transmit)

12 CMPE 80N - Introduction to Networks and the Internet 12 Packet Switching Sharing by taking turns. –Analogy: conveyor belt in a warehouse. –Items are picked from the storage room and placed on the conveyor belt every time a customer makes an order. –Different customers may request a different number of items –Different users’ items may be interspersed on the conveyor belt (they are “multiplexed”). Networks use a similar idea. –Packet switching: Packetize data to transfer. Multiplex it onto the wire. –Packets from different connections share the same link.

13 CMPE 80N - Introduction to Networks and the Internet 13 C DDDD CC A D B C Packet Switching Example PayloadHeader

14 CMPE 80N - Introduction to Networks and the Internet 14 Packet Switching Each packet is composed by payload (the data we want to transmit) and header. –The header contains information useful for transmission, such as: Source (sender’s) address. Destination (recipient’s) address.

15 CMPE 80N - Introduction to Networks and the Internet 15 Packet Switching (cont’d) –The header introduces overhead, that is, additional bits to be sent. –Tradeoff? What happens if the payload is too small? Or too big?

16 CMPE 80N - Introduction to Networks and the Internet 16 Circuit Switching vs Packet Switching Circuit switching Must set up a connection (initial delay) Resources are dedicated –Therefore they may be used inefficiently! Packet switching Very small set-up delay. Efficient shared use of resources. But, may may result in too many packets being injected into the network.

17 CMPE 80N - Introduction to Networks and the Internet 17 Queuing Packets are queued inside router, waiting to be transmitted on outgoing link.

18 CMPE 80N - Introduction to Networks and the Internet 18 Queuing (cont’d) What happens if packets are coming in faster than router is able to forward them? –Needs to “queue” the packets as they are waiting to be transmitted. What happens when a queue becomes too long? –Packets are dropped! How can the receiver detected that a packet was dropped? –Look at the packet sequence number!

19 CMPE 80N - Introduction to Networks and the Internet 19 Congestion Total offered load exceeds what network can handle. Congestion collapse: –When congestion occurs, packets get dropped. –Due to packet loss, packets get retransmitted. –Congestion gets worse and worse! –“Snow ball” effect.

20 CMPE 80N - Introduction to Networks and the Internet 20 Congestion Control Why do it at the transport layer? –Real fix to congestion is to slow down sender. Use law of “conservation of packets”. –Keep number of packets in the network constant. –Don’t inject new packet until old one leaves. Congestion indicator: packet loss.

21 CMPE 80N - Introduction to Networks and the Internet 21 TCP and Congestion Control Interprets packet loss as an indicator of congestion –When it senses packet loss, it slows down the rate of packet transmission –When packets are received correctly, sends packets faster Still within the limits of the sliding window

22 CMPE 80N - Introduction to Networks and the Internet 22 TCP Congestion Control Like, flow control, also window based. –Sender keeps congestion window. Goal: figure out size of congestion window. –Trade-off?

23 CMPE 80N - Introduction to Networks and the Internet 23 TCP Congestion Control (cont’d) Slow start [Jacobson 1988]: –Connection’s congestion window starts at 1 segment. –If segment ACKed before time out, cwin=cwin+1. –As ACKs come in, current cwin is increased by 1. –Exponential increase: 1, 2, 4, 8, etc.

24 CMPE 80N - Introduction to Networks and the Internet 24 TCP Congestion Control (cont’d) Congestion Avoidance: –Slow start is aggressive: exponential increase. Start low. But increase fast until finds available bandwidth. – Then, cwin grows linearly. –Upper bound set by flow control, I.e., maximum number of packets receiver can handle.

25 CMPE 80N - Introduction to Networks and the Internet 25 TCP Congestion Avoidance Congestion Avoidance: –cwin grows linearly until it reaches receiver’s advertised window. –If timeout, threshold=cwin/2 and cwin=1. – Re-enters slow-start until cwin=threshold.

26 CMPE 80N - Introduction to Networks and the Internet 26 TCP Congestion Control: Example threshold timeout threshold cwin time

27 CMPE 80N - Introduction to Networks and the Internet 27 TCP Retransmission Timer When segment sent, retransmission timer starts. –If segment ACKed, timer stops. –If time out, segment retransmitted and timer starts again.

28 CMPE 80N - Introduction to Networks and the Internet 28 How to set timer? Based on round-trip time: time between a segment is sent and ACK comes back. If timer is too short, unnecessary retransmissions. If timer is too long, long retransmission delay.

29 CMPE 80N - Introduction to Networks and the Internet 29 TCP Segment Header Source port Destination port Sequence number Acknowledgment number Header length UA PRSF Window size ChecksumUrgent pointer Options (0 or more 32-bit words) Data 0 16 31 15

30 CMPE 80N - Introduction to Networks and the Internet 30 TCP Header Fields Source and destination ports identify connection end points. Sequence number. Acknowledgment number specifies next byte expected. TCP header length: how many 32-bit words are contained in header. 6-bit unused field.

31 CMPE 80N - Introduction to Networks and the Internet 31 TCP Header Fields (cont’d) 6 1-bit flags: – URG: indicate urgent data present; urgent pointer gives byte offset from current sequence number where urgent data is. – ACK: indicates whether segment contains acknowledgment; if 0, acknowledgement number field ignored. – PUSH: indicates PUSHed data so receiver delivers it to application immediately.

32 CMPE 80N - Introduction to Networks and the Internet 32 TCP Header Fields (cont’d) Flags (cont’d): – RST: used to reset connection, reject invalid segment, or refuse to open connection. – SYN: used to establish connection; connection request, SYN=1, ACK=0. – FIN: used to release connection. Window size: how many bytes can be sent starting at acknowledgment number.

33 CMPE 80N - Introduction to Networks and the Internet 33 TCP Header Fields (cont’d) Checksum: checksums the header+data+pseudo-header. Options: provide way to add extra information. – Examples: Maximum payload host is willing to accept; can be advertised during connection setup. Window scale factor that allows sender and receiver to negotiate larger window sizes.

34 CMPE 80N - Introduction to Networks and the Internet 34 UDP Provides connection-less, unreliable service. – No delivery guarantees. – No ordering guarantees. – No duplicate detection. Low overhead. – No connection establishment/teardown. Suitable for short-lived connections. –Example: client-server applications.

35 CMPE 80N - Introduction to Networks and the Internet 35 UDP Segment Format 0 15 31 Source port Destination port Length Checksum Data Source and destination ports: identify the end points. Length: 8-byte header+ data. Checksum: optional; if not used, set to zero.

36 CMPE 80N - Introduction to Networks and the Internet 36 TCP and UDP TCP provides end-to-end communication. It takes care of reliable, error-free transfer of data, and in- sequence delivery UDP has less overhead compared to TCP, but does not guarantee transfers –TCP is preferred to transfer files –UDP is preferred to transfer audio/video streams In real-time streaming, we cannot afford the delay consequent to packet retransmission Both protocols support multiplexing, i.e. they allow several distinct streams of data between two hosts

37 CMPE 80N - Introduction to Networks and the Internet 37 The Domain Name System (DNS)

38 CMPE 80N - Introduction to Networks and the Internet 38 DNS IP addresses are not easy to remember. The Domain Name System (DNS) maps IP addresses to host names. Host name is formed by machine name followed by domain name. –Host_name.domain_name

39 CMPE 80N - Introduction to Networks and the Internet 39 DNS (cont’d) The domain_name is formed by the institutional site name and the Top-Level Domain name (TLD). –So the host name is of the form:machine_name.Ist_site_name.TLD_name Examples: –sundance.ucsc.edu –soe.ucsc.edu (alias for sundance.ucsc.edu) –italia.cse.ucsc.edu –helios.jpl.nasa.gov –www.cnn.com

40 CMPE 80N - Introduction to Networks and the Internet 40 TLD TLD names identify organization types or country codes. Examples:. comCommercial org..auAustralia.eduEducational site in US.caCanada.govGovernment site in US.frFrance.milMilitary organization in US.deGermany.netNetwork site.ukGreat Britain.orgNonprofit organization.itItaly.esSpain Countries define their own internal hierarchy (e.g.,.ac.uk,.edu.au)

41 CMPE 80N - Introduction to Networks and the Internet 41 DNS (cont’d) Organizations can create any internal DNS hierarchy. Authority for creating new subdomains within a domain name is delegated to each domain. –Administration of ucsc.edu has authority to create cse.ucsc.edu and need not contact any central naming authority.

42 CMPE 80N - Introduction to Networks and the Internet 42 Example of DNS Hierarchy

43 CMPE 80N - Introduction to Networks and the Internet 43 DNS Name Space DNS names are managed by a hierarchy of DNS servers. –Hierarchy is related to DNS domain hierarchy Root server at top of tree knows about next level servers. Next level servers, in turn, know about lower level servers.

44 CMPE 80N - Introduction to Networks and the Internet 44 Example of DNS Hierarchy

45 CMPE 80N - Introduction to Networks and the Internet 45 Example of DSN Hierarchy (cont’d)

46 CMPE 80N - Introduction to Networks and the Internet 46 Choosing DNS Server Architecture Small organizations can use a single server. –Easy to administer. –Inexpensive. Large organizations often use multiple servers. –Reliability through redundancy. –Improved response time through load sharing.

47 CMPE 80N - Introduction to Networks and the Internet 47 Name Resolution “Resolving a name” means mapping the host name to the IP address. Reverse mapping is also possible. A client computer calls a DNS server for name resolution –DNS request contains name to be resolved. –DNS reply contains IP address for name in request.

48 CMPE 80N - Introduction to Networks and the Internet 48 Using DNS Servers Each DNS server is the authoritative server for the names it manages. –If request contains name managed by receiving server, that server replies directly. –Otherwise, request is forwarded to the appropriate authoritative server. DNS request is originally sent to root server, which points at next server to use –Eventually, the authoritative server for the DNS name in the request is located and IP address is returned.


Download ppt "CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 9 Introduction to Networks and the Internet."

Similar presentations


Ads by Google