SocketProgramming

SocketProgramming - Today's Agenda 1 Overview of Socket...

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

View Full Document Right Arrow Icon
1 CSCI 232: Computer Networks Socket API 1 Today’s Agenda 1. Overview of Socket Programming 2. Project Description CSCI 232: Computer Networks Socket API 2 Socket Programming • Socket Programming Overview • BSD Unix C Socket Programming API • Handle asynchronous input output from multiple socket descriptors Additional Readings on BSD Socket on class website; Online Project I Description CSCI 232: Computer Networks Socket API 3 Soothing words Don’t worry too much about the sense of information overload you may get from this lecture. There is a lot of detail about sockets that you don’t need to remember, because you can look it up. Pay attention to the patterns and outlines of what’s going on, and use reference material for the details as you program. CSCI 232: Computer Networks Socket API 4 Refreshing • Host (NIC card) identified by unique IP address • Network application/process identified by port number • Network connection identified by a 5-tuple ( src ip, src port, dst ip, dst port, protocol ) • Two kinds of Internet transport services provided to applications – Connection-oriented TCP – Connectionless UDP CSCI 232: Computer Networks Socket API 5 Huh? • We haven’t yet covered the transport layer in class, and yet you’re being called on to use sockets to access transport services • This is partly a matter of semester mechanics, and partly because everything has to start somewhere • Treat this as your intro to the essentials of transport, with details to follow CSCI 232: Computer Networks Socket API 6 Socket Programming API • API: Application Programming Interface Socket analogous to door – sending process shoves message out door – sending process assumes transport infrastructure on other side of door that brings message to socket at receiving process – connection between sockets set-up/managed by OS process TCP with buffers, variables socket host or server process TCP with buffers, variables socket host or server Internet controlled by OS controlled by app developer
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 CSCI 232: Computer Networks Socket API 7 What APIs Needed? • How to create socket (door) • How to establish connection – Client connects to a server – Server accepts client req. • How to send/recv data • How to identify socket – Bind to local address/port • How to close socket (door) • How to create socket • How to send/recv data • How to identify socket • How to close socket Connection-Oriented TCP Connectionless UDP CSCI 232: Computer Networks Socket API 8 Socket: Conceptual View CSCI 232: Computer Networks Socket API 9 Another conceptual view Physical layer Link layer Internet layer Transport layer Other layers Socket {API/layer} Kernel Hardware User CSCI 232: Computer Networks Socket API 10 But why?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/25/2009 for the course CS 232 taught by Professor Susan during the Fall '09 term at GWU.

Page1 / 8

SocketProgramming - Today's Agenda 1 Overview of Socket...

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

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