Layering makes it Easier Application programmer Doesn t need to send ip packets Doesn 't need to send ethernet frames Doesnt need to know how TCP implements reliability Only need a way to pass the data down Socket is the api to access transport layer functions
Layering Makes it Easier • Application programmer – Doesn’t need to send IP packets – Doesn’t need to send Ethernet frames – Doesn’t need to know how TCP implements reliability • Only need a way to pass the data down – Socket is the API to access transport layer functions
What Lower Layer need to know? We pass the data down What else does the lower layer need to know?
What Lower Layer Need to Know? • We pass the data down. What else does the lower layer need to know?
What Lower Layer need to know? We pass the data down What else does the lower layer need to know? How to identify the destination process? Where to send the data?(Addressing What process gets the data when it is there? (Multiplexing)
What Lower Layer Need to Know? • We pass the data down. What else does the lower layer need to know? • How to identify the destination process? – Where to send the data? (Addressing) – What process gets the data when it is there? (Multiplexing)
Identify the Destination Addressing IP address hostname(resolve to iP address via dns · Multiplexing port Server socket address 208.216.181.15:80 Client socket address 128.2.194.242:3479 FTP Server (port 21) Client HttpseRver (1282194242:3479,208216181.15:80)4(port80) Connection socket pair Client host address Server host address 128.2.194.242 208.216.181.15
Identify the Destination Connection socket pair (128.2.194.242:3479, 208.216.181.15:80) HTTP Server (port 80) Client Client socket address 128.2.194.242:3479 Server socket address 208.216.181.15:80 Client host address 128.2.194.242 Server host address 208.216.181.15 FTP Server (port 21) • Addressing – IP address – hostname (resolve to IP address via DNS) • Multiplexing – port
Sockets How to use sockets Setup socket Where is the remote machine(ip address hostname What service gets the data(port) Send and receive Designed just like any other lyo in unix send--write recv-- read Close the socket
Sockets • How to use sockets – Setup socket • Where is the remote machine (IP address, hostname) • What service gets the data (port) – Send and Receive • Designed just like any other I/O in unix • send -- write • recv -- read – Close the socket