Title: CMPE 80N Spring 2003 Week 9
1CMPE 80N Spring 2003Week 9
- Introduction to Networks and the Internet
2Announcements
- 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 2s Web page.
- Final exam on 06.09 from 730-1030pm.
- Comprehensive.
- Location BE 152 and BE 165 (overflow room).
3Today
4Flow Control
- Flow control is necessary so that source doesnt
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.
5TCP Flow Control
- Sliding window.
- Receivers advertised window.
- Size of advertised window related to receivers
buffer space. - Sender can send data up to receivers advertised
window.
6TCP Sliding Window
7TCP Flow Control Example
App. writes 2K of data
4K
2KSEQ0
2K
ACK2048 WIN2048
App. does 3K write
2K SEQ2048
0
Sender blocked
App. reads 2K of data
ACK4096 WIN0
ACK4096 WIN2048
2K
1K SEQ4096
Sender may send up to 2K
1K
8Circuit- versus Packet Switching
9Circuit Switching
- Old telephone technology.
- For each connection, switches establish physical
circuit.
10Circuit Switching - Example
Switch
Switching offices
11Circuit Switching (contd)
- 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)
12Packet 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.
13Packet Switching Example
Payload
Header
A
C
D
B
14Packet 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 (senders) address.
- Destination (recipients) address.
15Packet Switching (contd)
- The header introduces overhead, that is,
additional bits to be sent. - Tradeoff?
- What happens if the payload is too small?
- Or too big?
16Circuit 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.
17Queuing
Packets are queued inside router, waiting to be
transmitted on outgoing link.
18Queuing (contd)
- 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!
19Congestion
- 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.
20Congestion 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.
- Dont inject new packet until old one leaves.
- Congestion indicator packet loss.
21TCP 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
22TCP Congestion Control
- Like, flow control, also window based.
- Sender keeps congestion window.
- Goal figure out size of congestion window.
- Trade-off?
23TCP Congestion Control (contd)
- Slow start Jacobson 1988
- Connections congestion window starts at 1
segment. - If segment ACKed before time out, cwincwin1.
- As ACKs come in, current cwin is increased by 1.
- Exponential increase 1, 2, 4, 8, etc.
24TCP Congestion Control (contd)
- 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.
25TCP Congestion Avoidance
- Congestion Avoidance
- cwin grows linearly until it reaches receivers
advertised window. - If timeout, thresholdcwin/2 and cwin1.
- Re-enters slow-start until cwinthreshold.
-
26TCP Congestion Control Example
cwin
timeout
threshold
threshold
time
27TCP Retransmission Timer
- When segment sent, retransmission timer starts.
- If segment ACKed, timer stops.
- If time out, segment retransmitted and timer
starts again.
28How 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.
29TCP Segment Header
0
31
16
15
Source port
Destination port
Sequence number
Acknowledgment number
Header length
P
R
S
F
U
A
Window size
Checksum
Urgent pointer
Options (0 or more 32-bit words)
Data
30TCP 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.
31TCP Header Fields (contd)
- 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.
32TCP Header Fields (contd)
- Flags (contd)
- RST used to reset connection, reject invalid
segment, or refuse to open connection. - SYN used to establish connection connection
request, SYN1, ACK0. - FIN used to release connection.
- Window size how many bytes can be sent starting
at acknowledgment number.
33TCP Header Fields (contd)
- Checksum checksums the headerdatapseudo-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.
34UDP
- 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.
35UDP Segment Format
0 15
31
Destination port
Source 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.
36TCP 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
37The Domain Name System (DNS)
38DNS
- 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
39DNS (contd)
- The domain_name is formed by the institutional
site name and the Top-Level Domain name (TLD). - So the host name is of the formmachine_name.Ist_s
ite_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
40TLD
- TLD names identify organization types or country
codes. - Examples
- .com Commercial org. .au Australia
- .edu Educational site in US .ca Canada
- .gov Government site in US .fr France
- .mil Military organization in US .de Germany
- .net Network site .uk Great Britain
- .org Nonprofit organization .it Italy
- .es Spain
- Countries define their own internal hierarchy
(e.g., .ac.uk, .edu.au)
41DNS (contd)
- 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.
42Example of DNS Hierarchy
43DNS 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.
44Example of DNS Hierarchy
45Example of DSN Hierarchy (contd)
46Choosing 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.
47Name 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.
48Using 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.