l2 Applications and Reliable Transport Basics

l2 Applications and Reliable Transport Basics -...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Applications and Reliable Transport Basics
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Overview Lookup and shutdown Applications: power of reliable sockets - Telnet - Web/HTTP - BitTorrent - Skype Challenges of reliable transport Next lecture: Reliable transport details
Background image of page 2
Address lookup details getaddrinfo notes: - Can specify port as service name or number (e.g., "80" or "http" , allows possibility of dynamically looking up port) - May return multiple addresses (chained with ai next field) - You must free structure with freeaddrinfo Other useful functions to know about - getnameinfo – Lookup hostname based on address - inet ntop – convert IPv4 or 6 address to printable form - inet pton – convert string to IPv4 or 6 address
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
EOF in more detail Simple client-server application - Client sends request - Server reads request, sends response - Client reads response What happens when you’re done? - Client wants server to read EOF to say request is done - But still needs to be able to read server reply – fd is not closed!
Background image of page 4
shutdown system call int shutdown (int fd, int how); - Shuts down a socket w/o closing file descriptor - how : 0 = reading, 1 = writing, 2 = both - Note: Applies to socket , not descriptor—so copies of descriptor (through dup or fork ) affected - Note 2: With TCP, can’t detect if other side shuts for reading, so in practice 1 is only useful how argument Play with uc from Lab 1 to see this - Pressing Ctrl-D at beginning of line sends EOF - uc reads EOF from standard input, uses shutdown to write EOF to TCP socket
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Review The Internet is a network of networks Hourglass/narrow waist: host-host delivery - IP protocol to deliver packets to hosts - Transport above for service/ process demultiplexing - Link layer below for a single hop Sockets are system call interface for communication FTP TCP UDP IP NET 1 NET 2 NET n HTTP NV TFTP
Background image of page 6
Applications Simple socket abstraction is very powerful - Applications can use them in many ways - We’ll go through four examples “the intelligence is end to end rather than hidden in the network.” [RFC 1958] (architectural principles doc) Two basic questions for an application - What do you send? - Whom do you send it to?
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
An Reliable Socket View of the World client server Internet Telnet: simple text stream HTTP: downloading documents BitTorrent: swarming large documents Skype: IP telephony/lookup
Background image of page 8
Telnet Server listens on port 23 On connection, provides a login prompt Allows insecure remote logins Telnet client is a text interface - Allows session management - Handles terminal control signals, etc.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 42

l2 Applications and Reliable Transport Basics -...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online