Lecture-04 - Lecture #04 1 Todays Objectives Sockets r What...

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

View Full Document Right Arrow Icon
Lecture #04 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Today’s Objectives Sockets What they are (including types) What they do How applications use them A bit about HW#1
Background image of page 2
Types of Sockets There are two types of sockets and each do different things Sockets are the bridge between the Application Layer and the Transport Layer Remember that the Transport Layer is “value-added services” on top of IP (end-to-end delivery) Types Stream (aka TCP) [not to be confused with streaming] Datagram (aka UDP)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Services Provided by Each Type Stream (aka TCP) Connections In-order delivery Reliability Congestion Control Multiplexing/Demultiplexing (sockets) Datagram (aka UDP) Multiplexing/Demultiplexing (sockets)
Background image of page 4
Using Sockets Use of a socket, from the perspective of sending and receiving data, is the same regardless of whether it is TCP or UDP In other words, the extra functionality of TCP is idden from the user hidden from the user With TCP is just seems like everything that is sent is always received in order at the other end The magic happens inside of the kernel
Background image of page 5

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

View Full DocumentRight Arrow Icon
Inside a Host Appl #1 TCP UDP Appl #2 Appl #3 Socket Socket Socket NIC Driver IP NIC Driver
Background image of page 6
The Four Pieces of Information Four pieces of information serve to differentiate communication from one application to any other application Source IP address Source Port Destination IP address Destination Port Key rule: no two applications can use the same port (but one application can use two ports)
Background image of page 7

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

View Full DocumentRight Arrow Icon
Four Pieces of Information Appl #1 TCP Appl #2 Socket Socket Appl #1 TCP Appl #2 Socket Socket NIC Driver IP NIC Driver IP
Background image of page 8
Client and Server Behavior Clients are easier Open a socket by specifying: the type, the destination IP address, and the destination port he source port is chosen by the OS as the next The source port is chosen by the OS as the next available (i.e., unused) local port Some ports are reserved (0-1024) • Many in this range are well known (e.g., Port 80 = web) Ports span the range from 0 to 65,535
Background image of page 9

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

View Full DocumentRight Arrow Icon
Client and Server Behavior Servers are slightly harder Have to deal with the possibility of multiple clients simultaneously Generally work by opening a socket and specifying the type and the local port on which to listen Then sit and listen until a packet is received When a packet is received, do stuff
Background image of page 10
Designing Application Layer Protocols A fairly straightforward process Since you control the design of the client and the server, whatever rules you make, you build into the client and server The hard part is dealing with the corner cases and hat s” art of the objective of HW#1 “what-ifs”—part of the objective of HW#1 The harder part is trying to write out a specification for a protocol Will your HW#1 clients work with others’ servers?
Background image of page 11

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

View Full DocumentRight Arrow Icon
Adding Application Layer Headers Also a fairly straightforward process Again, since you are in control of the client and server, you
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 36

Lecture-04 - Lecture #04 1 Todays Objectives Sockets r What...

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

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