复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)04 Socket Programming

Socket Programming Computer Networks, Spring 2013
Socket Programming Computer Networks, Spring 2013

Lecture today Motivation for sockets ·What' s in a socket? Working with socket Concurrent network applications Project 1
Lecture Today • Motivation for sockets • What’s in a socket? • Working with socket • Concurrent network applications • Project 1

Wh' y Socket? How can I program a network application? Share data Send messages Finish course projects IPC -Interprocess Communication
Why Socket? • How can I program a network application? – Share data – Send messages – Finish course projects... • IPC - Interprocess Communication

Network Layering 7 Application Application pResentation Presentation 5 Session Session tRansport Transport 3 Network Network Network 2 Data link Data link Data link Physical Physical Physical
Network Layering Application Presentation Session Transport Network Data link 1 Physical 2 3 4 5 6 7 Network Data link Physical Application Presentation Session Transport Network Data link Physical

Network Layering Why layering 7 Application Application pResentation Presentation 5 Session Session tRansport Transport 3 Network Network Network 2 Data link Data link Data link Physical Physical Physical
Network Layering • Why layering? Application Presentation Session Transport Network Data link 1 Physical 2 3 4 5 6 7 Network Data link Physical Application Presentation Session Transport Network Data link Physical

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
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)03 Design Philosophy & Applications.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)02 Protocol Stacks and Layering.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)01 Introduction.ppt
- 复旦大学:《计算机网络 Computer Networking》课程实验指导_拥塞控制_project3-congestion_control.ppt
- 复旦大学:《计算机网络 Computer Networking》课程实验指导_拥塞控制_project3_2013.pdf
- 复旦大学:《计算机网络 Computer Networking》课程实验指导_因特网中继聊天(IRC)路由_project 2 IRC routing.pptx
- 复旦大学:《计算机网络 Computer Networking》课程实验指导_因特网中继聊天(IRC)服务器_socketProgramming-Part2.pptx
- 复旦大学:《计算机网络 Computer Networking》课程实验指导_因特网中继聊天(IRC)服务器_socketProgramming-Part1.pptx
- 复旦大学:《计算机网络 Computer Networking》课程实验指导_因特网中继聊天(IRC)服务器_Network Project1 Request 2013.pdf
- 《计算机网络》课程教学资源(参考文献)MACAW_A Media Access Protocol for Wireless LAN’s.pdf
- 《计算机网络》课程教学资源(参考文献)Interdomain Internet Routing.pdf
- 《计算机网络》课程教学资源(参考文献)END-TO-END ARGUMENTS IN SYSTEM DESIGN.pdf
- 《计算机网络》课程教学资源(参考文献)Analysis and Simulation of a Fair Queueing Algorithm.pdf
- 《计算机网络》课程教学资源(参考文献)The Design Philosophy of the DARPA Internet Protocols.pdf
- 《计算机网络》课程教学资源(参考文献)Automated Worm Fingerprinting.pdf
- 《计算机网络》课程教学资源(参考文献)How to 0wn the Internet in Your Spare Time.pdf
- 《计算机网络》课程教学资源(参考文献)A DoS-limiting Network Architecture.pdf
- 《计算机网络》课程教学资源(参考文献)Hash-Based IP Traceback.pdf
- 《计算机网络》课程教学资源(参考文献)Internet Indirection Infrastructure.pdf
- 《计算机网络》课程教学资源(参考文献)Middleboxes No Longer Considered Harmful.pdf
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)05 physical_Transmission.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)06 Physical Layer(Cont)& Data Link Layer.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)07 Ethernet.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)08 Software School.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)09 IP Packets.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)10 Intra-Domain Routing.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)11 Multicast.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)12 Inter-Domain Routing BGP(Border Gateway Protocol).ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)13 DNS.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)14 ip-grab-bag(IP Wrap up).ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)15 Virtual Circuits, ATM, MPLS.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)16 Transport Protocols.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)17 TCP & Congestion Control.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)18 tcpdetails_More TCP & Congestion.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)19 TCP Performance.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)20 The Web.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)21 Peer-to-Peer(p2p).ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)22 Queue Management and QoS.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)23 mobile_Wireless Networking.ppt
- 复旦大学:《计算机网络 Computer Networking》课程电子教案(PPT课件讲稿)25 Secure Communication with an Insecure Internet Infrastructure.ppt