Communication Networks. Introduction & Socket Programming Yuval Rochman
|
|
- Abel Adams
- 8 years ago
- Views:
Transcription
1 Communication Networks Introduction & Socket Programming Yuval Rochman
2 Administration
3 Staff Lecturer: Prof. Hanoch Levy hanoch AT cs tau Office hours: by appointment Teaching Assistant: Yuval Rochman yuvalroc AT gmail.com Office hours: by appointment (feel free to schedule!) HW Grader: Alon Grinshpoon comnet2015a AT gmail.com 3
4 Assignments(1) 2-3 practical assignments C/C++ 20% of final grade 4-5 theoretical assignments Might include guided-reading 20% of final grade 4
5 Assignments(2) Submission is mandatory HW- submitted in pairs Moodle forum- to ask questions on HW Final Exam 60% of final grade 5
6 Course website: Moodle website Main textbook: References Computer Networking: A Top-down Approach, by J. F. Kurose and K. W. Ross (from 3 rd edition) Other references: Can be seen in appendix 6
7 Introduction
8 Why communication networks? Interface between theory & practice Understanding design principles of complex system Industry-relevant knowledge Research is practical! Fundamental Basics Information security Cloud computing SDN & OpenFlow 8
9 What is a network? (1) 9
10 What is a network? (2) Formally- system connecting Network Devices Computers Servers Routers Phones 10
11 Network communication(1) How is network communication done? A: Using protocols! Protocol- a set of rules for data exchange Sending correspond messages Example: automated attendant Pressing the right key (message) to get the right department 11
12 Network communication(2) Problem: Network communication is complex! Different protocols to multiple tasks! Optimal routing Handle data corruptions Loss of information 12
13 Solution- layering Layering Dividing protocols into layers Each layer tailored for different scope of tasks In our course- we use TCP/IP layering 5 layers 13
14 Physical layer Overview of TCP/IP(1) Transmits raw bits Data link layer Deliver frames (set of bits) Between nearby connected network devices Ethernet is a family of data link protocols 14
15 Network layer Overview of TCP/IP(2) Delivers packets across the network I.e how to forward the packets Between far network devices IPv4 and IPv6 is a forwarding network protocol 15
16 Transport layer Delivers data between end hosts Overview of TCP/IP(3) Define service of transportation Two protocols TCP: reliable, connectionoriented UDP: unreliable, connectionless End terminal End terminal 16
17 Application layer Overview of TCP/IP(4) Used to Implement an application over the network E.g FTP (used to transfer files) HTTP(used to browsing the internet) SMTP (used to transfer s) 17
18 Packet encapsulation(1) Protocol level i sends message via protocol level i-1 TCP (level 4) can use IPv4 (level 3) UDP can use IPv6 Every protocol adds its header before passing to the next protocol Data link, in addition, adds a tail 18
19 Packet encapsulation(2) Application A A Application Transport T h A T h A Transport Network N h T h A N h T h A Network Data link D h N h T h A D t D h N h T h A D t Data link Physical layer Glossary: A: Application message T h : Transport header N h : Network header D h : Data link header D t : Data link tail 19
20 Socket Programming Main reference- Beej's Guide to Network Programming
21 Why socket (network) programming? 21
22 IP address/ domain name Uniquely identifies a host on the network Not really, we ll get to that later in the course An 32\128-bit number (for IPv4\IPv6) (IPv4) Represented 4 numbers in the range E.g Domain names = nova.cs.tau.ac.il 22
23 Port(1) A 16-bit number (i.e., ) Identifies a service on the host Again, not quite, we ll get to that later, blah-blah. For instance: HTTP = 80, SMTP = 25. A socket address is a combination of IP + port : 80 23
24 Port(2) The server listens on a certain port The client randomly chooses a port For instance : : 80 Client Server 24
25 Relevant Headers #include <sys/socket.h> Sockets #include <netinet/in.h> Internet addresses #include <arpa/inet.h> Working with Internet addresses #include <netdb.h> Domain Name Service (DNS) #include <errno.h> Working with errno to report errors 25
26 Address Representation struct sockaddr { u_short sa_family; /* type of address (ipv4/ipv6) */ char sa_data[14]; /* 14 bytes of address }; General address representation used in socket programming functions 26
27 Address Representation IPv4 struct sockaddr_in { short sin_family; /* = AF_INET */ u_short sin_port; /* port number */ struct in_addr sin_addr; /* 32-bit address */ char sin_zero[8]; /* unused */ }; struct in_addr { } uint32_t s_addr; Except for sin_family, all contents are in network order 27
28 Big Endian / Little Endian Memory representation of multi-byte numbers: = ABCDEF12 16 Big Endian: 0xAB CD EF 12 (IBM z) Little Endian: 0x 12 EF CD AB (intel x86,arm) Hosts on the web must use same order Traditionally, Network order=big endian htonl () / ntohl() / htons() / ntohs() host to network long network to host short network to host long host to network short 28
29 TCP vs UDP TCP Reliable transport Connection oriented Keep state SOCK_STREAM UDP Unreliable transport connectionless stateless SOCK_DGRAM 29
30 Session overview(tcp) Client TCP Server socket() bind() socket() listen() connect() session start accept() send() data transfer recv() recv() data transfer send() close() terminate session close() 30
31 Socket creation socket() int socket(int domain, int type, int protocol); domain: PF_INET for IPv4 type: SOCK_STREAM (tcp) or SOCK_DGRAM (udp) protocol: set to 0 (default protocol) Returns new socket descriptor or -1 on error In error- errno is set. socket descriptor is used in subsequent calls Don t forget to close the socket when you re done with it Server socket() bind() listen() accept() recv() send() close() 31
32 Bind socket to IP and port bind() int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen); sockfd : socket descriptor my_addr: address to associate with the socket IP portion often set to INADDR_ANY INADDR_ANY bind to all IP address associate with machine addrlen: set to sizeof(my_addr) Returns 0 on success, or -1 on error errno is set accordingly in error. Server socket() bind() listen() accept() recv() send() close() 32
33 Wait for an incoming call listen() int listen(int sockfd, int backlog); sockfd : socket descriptor backlog: number of pending clients. Before starting to refuse connections. Returns 0 on success, or -1 on error Errno is set accordingly in error. Server socket() bind() listen() accept() recv() send() close() 33
34 Accept an incoming call accept() int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); sockfd : socket descriptor addr: contains the address of client which connects server. addrlen: contains the sizeof() the structure returned in the addr parameter Returns the newly connected socket descriptor, or -1 on error, with errno set appropriately. Don t forget to close the returned socket when done with it Server socket() bind() listen() accept() recv() send() close() 34
35 Server-side example sock = socket(pf_inet, SOCK_STREAM, 0); myaddr.sin_family = AF_INET; myaddr.sin_port = htons( 80 ); myaddr.sin_addr = htonl( INADDR_ANY ); bind(sock, &myaddr, sizeof(myaddr)); listen(sock, 5); sin_size = sizeof(struct sockaddr_in); new_sock = accept(sock, (struct sockaddr*) &their_addr, &sin_size); Server socket() bind() listen() accept() recv() send() close() In real-life code, don t forget to check for errors 35
36 Session overview(tcp) Client TCP Server socket() bind() socket() listen() connect() session start accept() send() data transfer recv() recv() data transfer send() close() terminate session close() 36
37 Connect to a listening socket connect() int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen); sockfd : socket descriptor serv_addr: the address you re connecting to. addrlen: set to sizeof(serv_addr) Returns 0 on success. or -1 on error (and errno is set accordingly). Most of the times, no bind() is required on the client side If bind() wasn t called local IP address and random high port are used. Client socket() connect() send() recv() close() 37
38 Client-side example sock = socket(pf_inet, SOCK_STREAM, 0); dest_addr.sin_family = AF_INET; dest_addr.sin_port = htons( 80 ); dest_addr.sin_addr = htonl(0x8443fc64); connect(sock, (struct sockaddr*) &dest_addr, sizeof(struct sockaddr)); In real-life, the server s IP is not hard-coded In real-life code, don t forget to check for errors Client socket() connect() send() recv() close() 38
39 Session overview Once session is initiated, both parties can Send and receive data Both can decide it s time to close the connection As long as the listening socket is open: it can accept new incoming clients by calling accept() Client socket() connect() send() recv() close() Server socket() bind() listen() accept() recv() send() close() accept() 39
40 Closing a connection close() int close(int sockfd); sockfd : socket descriptor Returns 0 on success, or -1 on error (and errno is set accordingly) After we close a socket: If the remote side calls recv(), it will return 0. If the remote side calls send(), it return -1 & errno will be set to EPIPE. In this case SIGPIPE signal is received. If errno!=epipe- you have a system error in send() 40
41 Session overview (UDP) Client TCP Server socket() socket() bind() sendto() data transfer recvfrom() recvfrom() data transfer sendto() close() terminate session close() 41
42 Sending data (TCP + UDP) TCP: ssize_t send(int socket, const void *buffer, size_t length, int flags); UDP: ssize_t sendto(int socket, const void *buffer, size_t length, int flags, const struct sockaddr *dest_addr, socklen_t dest_len); buffer: buffer of the data to send length: number of bytes to send. flags: send options. Refer to the man pages. Use 0 for no options. In unconnected sockets (UDP) you specify the destination in each sendto() 42
43 Partial send send() sendto() returns # of bytes actually sent or -1 on error (and errno is set accordingly). If error=-1 and errno set to EPIPE- remote side has closed its connection! The # of bytes actually sent might be less than the # you asked it to send. 43
44 A code considering partial sending int sendall(int s, char *buf, int *len) { int total = 0; /* how many bytes we've sent */ int bytesleft = *len; /* how many we have left to send */ int n; } while(total < *len) { n = send(s, buf+total, bytesleft, 0); if (n == -1) { break; } total += n; bytesleft -= n; } *len = total; /* return number actually sent here */ return n == -1? -1:0; /*-1 on failure, 0 on success */ 44
45 Receiving data (TCP + UDP) TCP: ssize_t recv(int socket, void *buffer, size_t length, int flags); UDP: ssize_t recvfrom(int socket, void *buffer, size_t length, int flags, struct sockaddr *from_addr, socklen_t * from_len); buffer : allocated space for the received data, length: buffer size ( = max data received by call ) flags: receive options. Refer to the man pages. Use 0 for no options. 45
46 Receiving data (TCP + UDP) recv() & recvfrom() returns # bytes received, or -1 if error occurred (and errno is set accordingly). Need to write a similiar recvall() function In TCP sockets, 0 is returned if remote host closed its connection. In UDP from_addr is the source address of the received message. from_len should point to sizeof(from_addr) 46
47 Translating a host name to an IP address int getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res); Supports many options and thus seems complex, but basic use is simple. Refer to Beej s guide for more info & example oman.html Don t forget to use freeaddrinfo() to release memory when you re done with getaddrinfo s result. 47
48 inet_pton() Other Useful Functions Convert IP addresses from human readable text (i.e ) to integer (uint32_ type) inet_ntop() Convert IP addresses from binary to human readable text getpeername() Return address info about the remote side of the connection. Used after calling accept() (server) or connect() (client) 48
49 How to define a protocol Tips for defining a protocol
50 Protocol design Two ways to define protocols Binary protocol (as DNS) Textual protocols (as HTTP) 50
51 Binary protocol(example) DNS response for query e 6e 03 6f c0 0c c Text view:.s... X
52 Textual protocol(example) HTTP request for the page GET /rfc/rfc3514.txt HTTP/1.1 Host: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO ,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive 52
53 Binary vs Textual Binary messages are small compare to textual messages Binary Messages are difficult to read and debug. 53
54 Message representation(1) We transfers a stream of data send() and recv() do not necessarily match message boundaries! Can receive multiple messages together / parts of messages. The application protocol must define a way to separate messages within the stream. 54
55 Message representation(2) Bad: messages have always constant size hello = 0x C 6C 6F Better: use a length field hello =0x C 6C 6F Another method: Define a delimiter between different messages hello + hello == 0x C 6C 6F C 6C 6F Must bound every message by a constant size 55
56 Portability In our assignments- it is not require Code is not portable 32-bit vs 64-bit computers. Different endianity machines Windows vs Linux computers Different compilers. To make your code to be portable- see appendix 56
57 Word of caution packing(1) Assume you have a struct represents protocol header struct ProtocolHeader { unsigned short datagramlength; unsigned short datagramtype; unsigned char flag; //... }; 57
58 Word of caution packing (2) Compiler may add padding Sending the struct asis is: Expensive in space Not portable Not follows application specification Output: S s size is: 24 #include <stdio.h> #include <stddef.h> struct S { short i; /* 2 bytes */ int j; /* 4 bytes */ char k; /* 1 byte */ double l; /* 8 bytes */ }; int main() { printf("s's size is: %ld\r\n\r\n", sizeof(s) ); } 58
59 Word of caution packing (3) Possible solution: use #pragma pack & #pragma pop Compiler portability issues Is OK with GNU,Microsoft Visual Studio, Borland Output: T s size is: 15 #include <stdio.h> #include <stddef.h> #pragma pack(push, 1) struct T { short i; /* 2 bytes */ int j; /* 4 bytes */ char k; /* 1 byte */ double l; /* 8 bytes */ }; #pragma pack(pop) int main() { printf("t's size is: %ld\r\n\r\n", sizeof(t) ); } 59
60 Packing Disadvantage Using packing reduces system performance Accesses to members of packed struct is slower Use packing only on structs representing protocols. 60
61 Handling blocking calls
62 Blocking function calls Many functions blocking until a certain event: accept: until client initiates session connect: until connection is (half) established recv, recvfrom: until data is received send, sendto: until data is pushed into socket s buffer What should we do in complex programs? multiple connections simultaneous sends and receives simultaneously doing non-networking processing 62
63 How do we handle blocking? There are several ways: Initiate multiple threads\processes Do not allow blocking by using fcntl() Call a function only when it s guaranteed not to block select(), pselect(), poll(), ppoll() In the next slides will explain select() 63
64 Select(1) select() receives a set of fd s (socket ids) Returns which of them are: Read-ready: recv() or accept() will not block Write-ready: send() or connect() will not block Expect-ready Not relevant to our course (rarely used in practice) 64
65 Select(2) int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); nfds: highest-numbered file descriptor in any of the three sets, plus 1. readfds, writefds, exceptfds: sets of fd s to see if they re read-ready, write-ready or except-ready. Any set can be replaced with NULL Set exceptfds to be NULL timeout: timeout parameter 65
66 Select(3) Returns when one of the fd s becomes ready, or when the timeout expires Returns total number of ready fd s in all the sets. Returns 0 if timeout expired Returns -1 on error (and errno is set accordingly). The sets are changed to indicate which fd s are ready. 66
67 Working with fd_set void FD_ZERO (fd_set *set) Initializes to an empty set void FD_SET (int fd, fd_set *set) Adds fd to the set int FD_ISSET (int fd, fd_set *set) Returns non-zero value if fd is in the set, 0 otherwise void FD_CLR (int fd, fd_set *set) Removes fd from the set stdin, stdout, stderr are associated with fd s 0, 1, 2 67
68 struct timeval { }; select s timeout argument long tv_sec; /* seconds */ long tv_usec; /* microseconds, always less than 10^6 */ Pass (0,0) to return immediately Pass NULL pointer to wait indefinitely Until one of the fd s is ready Some OS s decrease the time elapsed Linux does 68
69 fd_set read_fds; select example for(;;) {/* main loop of the program */ FD_ZERO(&read_fds); /* reset fd set */ FD_SET(listening_sock, &read_fds); for(/* for each active client with fd = client_sock */) { FD_SET(client_sock, &read_fds); } fdmax = /* the highest fd in read_fds */ select(fdmax + 1, &read_fds, NULL, NULL, NULL); if (FD_ISSET(listening_sock, &read_fds)) { /* listening socket is read-ready: a new client is available. */ /* new_client_sock = accept(listening_sock, */ } for(/* for each active client with fd = client_sock */) { if (FD_ISSET(client_sock, &read_fds)) { /*client socket is read ready unread data is available */ /* nbytes = recv(client_sock, */ } } } /*END main program loop */ 69
70
71 Appendix
72 References-other books Computer Networks, by A. S. Tanenbaum (4th edition or later). Computer Networks: A Systems Approach, by L. L. Peterson and B. S. Davie (3rd edition or later). An Engineering Approach to Computer Networking, by S. Keshav. Unix Network Programming, by W. R. Stevens, B. Fenner and A.M. Rudoff. 72
73 Portability Must use uniform endianity for application messages NOTE: IP & port must used network order Even in non-portable code (why?) Must use the same data types I.e, sizeof(long) can be 4 or 8! Use int16_t, uint32_t, etc For floating point number- see beej s guide. Compile with ANSI C90 Compatibility between compilers Avoid padding Include WINSOCK liberies Socket programming API in Windows is similar to LINUX 73
Socket Programming. Kameswari Chebrolu Dept. of Electrical Engineering, IIT Kanpur
Socket Programming Kameswari Chebrolu Dept. of Electrical Engineering, IIT Kanpur Background Demultiplexing Convert host-to-host packet delivery service into a process-to-process communication channel
More informationUnix Network Programming
Introduction to Computer Networks Polly Huang EE NTU http://cc.ee.ntu.edu.tw/~phuang phuang@cc.ee.ntu.edu.tw Unix Network Programming The socket struct and data handling System calls Based on Beej's Guide
More informationTutorial on Socket Programming
Tutorial on Socket Programming Computer Networks - CSC 458 Department of Computer Science Seyed Hossein Mortazavi (Slides are mainly from Monia Ghobadi, and Amin Tootoonchian, ) 1 Outline Client- server
More informationSocket Programming. Srinidhi Varadarajan
Socket Programming Srinidhi Varadarajan Client-server paradigm Client: initiates contact with server ( speaks first ) typically requests service from server, for Web, client is implemented in browser;
More informationIntroduction to Socket Programming Part I : TCP Clients, Servers; Host information
Introduction to Socket Programming Part I : TCP Clients, Servers; Host information Keywords: sockets, client-server, network programming-socket functions, OSI layering, byte-ordering Outline: 1.) Introduction
More informationELEN 602: Computer Communications and Networking. Socket Programming Basics
1 ELEN 602: Computer Communications and Networking Socket Programming Basics A. Introduction In the classic client-server model, the client sends out requests to the server, and the server does some processing
More informationICT SEcurity BASICS. Course: Software Defined Radio. Angelo Liguori. SP4TE lab. angelo.liguori@uniroma3.it
Course: Software Defined Radio ICT SEcurity BASICS Angelo Liguori angelo.liguori@uniroma3.it SP4TE lab 1 Simple Timing Covert Channel Unintended information about data gets leaked through observing the
More informationSocket Programming. Request. Reply. Figure 1. Client-Server paradigm
Socket Programming 1. Introduction In the classic client-server model, the client sends out requests to the server, and the server does some processing with the request(s) received, and returns a reply
More informationLab 4: Socket Programming: netcat part
Lab 4: Socket Programming: netcat part Overview The goal of this lab is to familiarize yourself with application level programming with sockets, specifically stream or TCP sockets, by implementing a client/server
More informationIntroduction to Socket programming using C
Introduction to Socket programming using C Goal: learn how to build client/server application that communicate using sockets Vinay Narasimhamurthy S0677790@sms.ed.ac.uk CLIENT SERVER MODEL Sockets are
More informationNS3 Lab 1 TCP/IP Network Programming in C
NS3 Lab 1 TCP/IP Network Programming in C Dr Colin Perkins School of Computing Science University of Glasgow http://csperkins.org/teaching/ns3/ 13/14 January 2015 Introduction The laboratory exercises
More informationPorting applications & DNS issues. socket interface extensions for IPv6. Eva M. Castro. ecastro@dit.upm.es. dit. Porting applications & DNS issues UPM
socket interface extensions for IPv6 Eva M. Castro ecastro@.upm.es Contents * Introduction * Porting IPv4 applications to IPv6, using socket interface extensions to IPv6. Data structures Conversion functions
More informationCSE 333 SECTION 6. Networking and sockets
CSE 333 SECTION 6 Networking and sockets Goals for Today Overview of IP addresses Look at the IP address structures in C/C++ Overview of DNS Write your own (short!) program to do the domain name IP address
More informationTCP/IP - Socket Programming
TCP/IP - Socket Programming jrb@socket.to.me Jim Binkley 1 sockets - overview sockets simple client - server model look at tcpclient/tcpserver.c look at udpclient/udpserver.c tcp/udp contrasts normal master/slave
More informationImplementing Network Software
Implementing Network Software Outline Sockets Example Process Models Message Buffers Spring 2007 CSE 30264 1 Sockets Application Programming Interface (API) Socket interface socket : point where an application
More informationVMCI Sockets Programming Guide VMware ESX/ESXi 4.x VMware Workstation 7.x VMware Server 2.0
VMware ESX/ESXi 4.x VMware Workstation 7.x VMware Server 2.0 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition.
More informationUNIX Sockets. COS 461 Precept 1
UNIX Sockets COS 461 Precept 1 Clients and Servers Client program Running on end host Requests service E.g., Web browser Server program Running on end host Provides service E.g., Web server GET /index.html
More informationOverview. Socket Programming. Using Ports to Identify Services. UNIX Socket API. Knowing What Port Number To Use. Socket: End Point of Communication
Overview Socket Programming EE 122: Intro to Communication Networks Vern Paxson TAs: Lisa Fowler, Daniel Killebrew, Jorge Ortiz Socket Programming: how applications use the network Sockets are a C-language
More informationSocket Programming in C/C++
September 24, 2004 Contact Info Mani Radhakrishnan Office 4224 SEL email mradhakr @ cs. uic. edu Office Hours Tuesday 1-4 PM Introduction Sockets are a protocol independent method of creating a connection
More informationINTRODUCTION UNIX NETWORK PROGRAMMING Vol 1, Third Edition by Richard Stevens
INTRODUCTION UNIX NETWORK PROGRAMMING Vol 1, Third Edition by Richard Stevens Read: Chapters 1,2, 3, 4 Communications Client Example: Ex: TCP/IP Server Telnet client on local machine to Telnet server on
More informationThe POSIX Socket API
The POSIX Giovanni Agosta Piattaforme Software per la Rete Modulo 2 G. Agosta The POSIX Outline Sockets & TCP Connections 1 Sockets & TCP Connections 2 3 4 G. Agosta The POSIX TCP Connections Preliminaries
More informationSystem calls. Problem: How to access resources other than CPU
System calls Problem: How to access resources other than CPU - Disk, network, terminal, other processes - CPU prohibits instructions that would access devices - Only privileged OS kernel can access devices
More informationNetworks. Inter-process Communication. Pipes. Inter-process Communication
Networks Mechanism by which two processes exchange information and coordinate activities Inter-process Communication process CS 217 process Network 1 2 Inter-process Communication Sockets o Processes can
More informationProgrammation Systèmes Cours 9 UNIX Domain Sockets
Programmation Systèmes Cours 9 UNIX Domain Sockets Stefano Zacchiroli zack@pps.univ-paris-diderot.fr Laboratoire PPS, Université Paris Diderot 2013 2014 URL http://upsilon.cc/zack/teaching/1314/progsyst/
More informationComputer Networks Network architecture
Computer Networks Network architecture Saad Mneimneh Computer Science Hunter College of CUNY New York - Networks are like onions - They stink? - Yes, no, they have layers Shrek and Donkey 1 Introduction
More informationUNIX. Sockets. mgr inż. Marcin Borkowski
UNIX Sockets Introduction to Sockets Interprocess Communication channel: descriptor based two way communication can connect processes on different machines Three most typical socket types (colloquial names):
More informationIT304 Experiment 2 To understand the concept of IPC, Pipes, Signals, Multi-Threading and Multiprocessing in the context of networking.
Aim: IT304 Experiment 2 To understand the concept of IPC, Pipes, Signals, Multi-Threading and Multiprocessing in the context of networking. Other Objective of this lab session is to learn how to do socket
More informationNetworks class CS144 Introduction to Computer Networking Goal: Teach the concepts underlying networks Prerequisites:
CS144 Introduction to Computer Networking Instructors: Philip Levis and David Mazières CAs: Juan Batiz-Benet, Behram Mistree, Hariny Murli, Matt Sparks, and Tony Wu Section Leader: Aki Kobashi cs144-staff@scs.stanford.edu
More informationApplication Architecture
A Course on Internetworking & Network-based Applications CS 6/75995 Internet-based Applications & Systems Design Kent State University Dept. of Science LECT-2 LECT-02, S-1 2 Application Architecture Today
More informationNetwork Programming with Sockets. Process Management in UNIX
Network Programming with Sockets This section is a brief introduction to the basics of networking programming using the BSD Socket interface on the Unix Operating System. Processes in Unix Sockets Stream
More informationDESIGN AND IMPLEMENT AND ONLINE EXERCISE FOR TEACHING AND DEVELOPMENT OF A SERVER USING SOCKET PROGRAMMING IN C
DESIGN AND IMPLEMENT AND ONLINE EXERCISE FOR TEACHING AND DEVELOPMENT OF A SERVER USING SOCKET PROGRAMMING IN C Elena Ruiz Gonzalez University of Patras University of Granada ERASMUS STUDENT:147 1/100
More informationKATRAGADDA INNOVATIVE TRUST FOR EDUCATION NETWORK PROGRAMMING. Notes prepared by D. Teja Santosh, Assistant Professor, KPES, Shabad, R.R. District.
KATRAGADDA INNOVATIVE TRUST FOR EDUCATION NETWORK PROGRAMMING 2 P age N E T W O R K P R O G R A M M I N G INTRODUCTION UNIT-I Introduction and TCP/IP When writing programs that communicate across a computer
More informationOperating Systems Design 16. Networking: Sockets
Operating Systems Design 16. Networking: Sockets Paul Krzyzanowski pxk@cs.rutgers.edu 1 Sockets IP lets us send data between machines TCP & UDP are transport layer protocols Contain port number to identify
More informationProgramming guidelines on transition to IPv6
Programming guidelines on transition to IPv6 Tomás P. de Miguel and Eva M. Castro tmiguel@dit.upm.es eva@gsyc.escet.urjc.es Department of Telematic Systems Engineering (DIT) Technical University of Madrid
More informationNetwork Programming with Sockets. Anatomy of an Internet Connection
Network Programming with Sockets Anatomy of an Internet Connection Client socket address 128.2.194.242:51213 socket address 208.216.181.15:80 Client Connection socket pair (128.2.194.242:51213, 208.216.181.15:80)
More informationSession NM059. TCP/IP Programming on VMS. Geoff Bryant Process Software
Session NM059 TCP/IP Programming on VMS Geoff Bryant Process Software Course Roadmap Slide 160 NM055 (11:00-12:00) Important Terms and Concepts TCP/IP and Client/Server Model Sockets and TLI Client/Server
More informationNetwork programming, DNS, and NAT. Copyright University of Illinois CS 241 Staff 1
Network programming, DNS, and NAT Copyright University of Illinois CS 241 Staff 1 Today Network programming tips Domain name system Network Address Translation Bonus slides (for your reference) Timers
More informationIPv6 Enabling CIFS/SMB Applications
IPv6 Enabling CIFS/SMB Applications 2010 Storage Developers Conference Santa Clara Dr David Holder CEng FIET MIEEE david.holder@erion.co.uk http://www.erion.co.uk Background Erion David Holder Over twelve
More informationReview of Previous Lecture
Review of Previous Lecture Principles of app layer protocols clients and servers app requirements Web and HTTP FTP Some slides are in courtesy of J. Kurose and K. Ross Announcement All got partners and
More informationProgramming with TCP/IP Best Practices
Programming with TCP/IP Best Practices Matt Muggeridge TCP/IP for OpenVMS Engineering "Be liberal in what you accept, and conservative in what you send" Source: RFC 1122, section 1.2.2 [Braden, 1989a]
More informationWriting Client/Server Programs in C Using Sockets (A Tutorial) Part I. Session 5958. Greg Granger grgran@sas. sas.com. SAS/C & C++ Support
Writing Client/Server Programs in C Using Sockets (A Tutorial) Part I Session 5958 Greg Granger grgran@sas sas.com SAS Slide 1 Feb. 1998 SAS/C & C++ Support SAS Institute Part I: Socket Programming Overview
More informationLecture 17. Process Management. Process Management. Process Management. Inter-Process Communication. Inter-Process Communication
Process Management Lecture 17 Review February 25, 2005 Program? Process? Thread? Disadvantages, advantages of threads? How do you identify processes? How do you fork a child process, the child process
More informationSoftware changes for Website and Application IPv6 Readiness
Software changes for Website and Application IPv6 Readiness Ahmed Abu-Abed, P.Eng. Tamkien Systems ahmed@tamkien.com 1 Agenda Introduction Enabling Website IPv6 and Forum Certification Intro to Socket
More informationDirect Sockets. Christian Leber christian@leber.de. Lehrstuhl Rechnerarchitektur Universität Mannheim 25.1.2005
1 Direct Sockets 25.1.2005 Christian Leber christian@leber.de Lehrstuhl Rechnerarchitektur Universität Mannheim Outline Motivation Ethernet, IP, TCP Socket Interface Problems with TCP/IP over Ethernet
More informationBSD Sockets Interface Programmer s Guide
BSD Sockets Interface Programmer s Guide Edition 6 B2355-90136 HP 9000 Networking E0497 Printed in: United States Copyright 1997 Hewlett-Packard Company. Legal Notices The information in this document
More informationClient / Server Programming with TCP/IP Sockets
Client / Server Programming with TCP/IP Sockets Author: Rajinder Yadav Date: Sept 9, 2007 Revision: Mar 11, 2008 Web: http://devmentor.org Email: rajinder@devmentor.org Table of Content Networks... 2 Diagram
More informationWindows Socket Programming & IPv6 Translation Middleware
Windows Socket Programming IPv6 Translation Middleware Dr. Whai-En Chen VoIP and IPv6 Laboratory Research Assistant Professor Dept. of Computer Science and Information Engineering National Chiao Tung University
More informationWriting a C-based Client/Server
Working the Socket Writing a C-based Client/Server Consider for a moment having the massive power of different computers all simultaneously trying to compute a problem for you -- and still being legal!
More informationConcurrent Server Design Alternatives
CSCE 515: Computer Network Programming ------ Advanced Socket Programming Wenyuan Xu Concurrent Server Design Alternatives Department of Computer Science and Engineering University of South Carolina Ref:
More informationGeneralised Socket Addresses for Unix Squeak 3.9 11
Generalised Socket Addresses for Unix Squeak 3.9 11 Ian Piumarta 2007 06 08 This document describes several new SocketPlugin primitives that allow IPv6 (and arbitrary future other) address formats to be
More informationBuilding Applications With Sockets
C C Building Applications With Sockets Topics & Goals: Sockets mechanism & its use App layer design & implementation principles Building applications using sockets D Sockets: Unifying Transport API Simplify
More informationElementary Name and Address. Conversions
Elementary Name and Address Domain name system Conversions gethostbyname Function RES_USE_INET6 resolver option gethostbyname2 Function and IPv6 support gethostbyaddr Function uname and gethostname Functions
More informationIBM i Version 7.2. Programming Socket programming IBM
IBM i Version 7.2 Programming Socket programming IBM IBM i Version 7.2 Programming Socket programming IBM Note Before using this information and the product it supports, read the information in Notices
More informationNetwork Programming TDC 561
Network Programming TDC 561 Lecture # 1 Dr. Ehab S. Al-Shaer School of Computer Science & Telecommunication DePaul University Chicago, IL 1 Network Programming Goals of this Course: Studying, evaluating
More informationDomain Name System (1)! gethostbyname (2)! gethostbyaddr (2)!
Lecture 5 Overview Last Lecture Socket Options and elementary UDP sockets This Lecture Name and address conversions & IPv6 Source: Chapter 11 Next Lecture Multicast Source: Chapter 12 1 Domain Name System
More informationAn Overview of IPv6 CHAPTER
56982_CH02I 12/12/97 3:29 PM Page 23 2 CHAPTER 2 An Overview of IPv6 This second chapter is meant to provide a general overview of the IPv6 protocol and of the way network layer protocols operate. These
More informationPacket Sniffing and Spoofing Lab
SEED Labs Packet Sniffing and Spoofing Lab 1 Packet Sniffing and Spoofing Lab Copyright c 2014 Wenliang Du, Syracuse University. The development of this document is/was funded by the following grants from
More informationIP - The Internet Protocol
Orientation IP - The Internet Protocol IP (Internet Protocol) is a Network Layer Protocol. IP s current version is Version 4 (IPv4). It is specified in RFC 891. TCP UDP Transport Layer ICMP IP IGMP Network
More informationThe exam has 110 possible points, 10 of which are extra credit. There is a Word Bank on Page 8. Pages 7-8 can be removed from the exam.
CS326e Spring 2014 Midterm Exam Name SOLUTIONS UTEID The exam has 110 possible points, 10 of which are extra credit. There is a Word Bank on Page 8. Pages 7-8 can be removed from the exam. 1. [4 Points]
More informationBest practices in IPv6 enabled networking software development. <mauro@deepspace6.net>
Best practices in IPv6 enabled networking software development 1 The IPv6 Protocol 1 New version of the Internet Protocol Devised by IETF to replace IPv4 It solves all the problems of IPv4 Address space
More information2057-15. First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring
2057-15 First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring 7-25 September 2009 TCP/IP Networking Abhaya S. Induruwa Department
More informationLimi Kalita / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 5 (3), 2014, 4802-4807. Socket Programming
Socket Programming Limi Kalita M.Tech Student, Department of Computer Science and Engineering, Assam Down Town University, Guwahati, India. Abstract: The aim of the paper is to introduce sockets, its deployment
More informationCOS 461: Computer Networks
COS 461: Computer Networks Spring 2011 Lectures: MW 10 10:50am in Bowen 222 Prof. Mike Freedman Precepts: F 10 10:50am, 11 11:50am Preceptors: Matvey Arye, Jacopo Cesareo, Prem Gopalan hnp://www.cs.princeton.edu/courses/archive/spr11/cos461/
More informationData Communication Networks. Lecture 1
Data Communication Networks Lecture 1 Saad Mneimneh Computer Science Hunter College of CUNY New York Primitive forms of networks.................................................... 2 Early networks.............................................................
More informationHardware Prerequisites Atmel SAM W25 Xplained Pro Evaluation Kit Atmel IO1 extension Micro-USB Cable (Micro-A / Micro-B)
USER GUIDE Software Programming Guide for SAM W25 Xplained Pro Atmel SmartConnect Prerequisites Hardware Prerequisites Atmel SAM W25 Xplained Pro Evaluation Kit Atmel IO1 extension Micro-USB Cable (Micro-A
More informationSMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2
SMTP-32 Library Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows Version 5.2 Copyright 1994-2003 by Distinct Corporation All rights reserved Table of Contents 1 Overview... 5 1.1
More informationObjectives of Lecture. Network Architecture. Protocols. Contents
Objectives of Lecture Network Architecture Show how network architecture can be understood using a layered approach. Introduce the OSI seven layer reference model. Introduce the concepts of internetworking
More informationLecture 28: Internet Protocols
Lecture 28: Internet Protocols 15-110 Principles of Computing, Spring 2016 Dilsun Kaynar, Margaret Reid-Miller, Stephanie Balzer Reminder: Exam 2 Exam 2 will take place next Monday, on April 4. Further
More informationImplementing and testing tftp
CSE123 Spring 2013 Term Project Implementing and testing tftp Project Description Checkpoint: May 10, 2013 Due: May 29, 2013 For this project you will program a client/server network application in C on
More information>>> SOLUTIONS <<< c) The OSI Reference Model has two additional layers. Where are these layers in the stack and what services do they provide?
Midterm Exam for Computer Networks (CNT 4004) Fall 2013 >>> SOLUTIONS
More informationNetwork-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2
Network-Oriented Software Development Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2 Topics Layering TCP/IP Layering Internet addresses and port numbers Encapsulation
More informationA Client Server Transaction. Introduction to Computer Systems 15 213/18 243, fall 2009 18 th Lecture, Nov. 3 rd
A Client Server Transaction Introduction to Computer Systems 15 213/18 243, fall 2009 18 th Lecture, Nov. 3 rd 4. Client handles response Client process 1. Client sends request 3. Server sends response
More informationCHAPTER 7. E-Mailing with CGI
CHAPTER 7 E-Mailing with CGI OVERVIEW One of the most important tasks of any CGI program is ultimately to let someone know that something has happened. The most convenient way for users is to have this
More informationHostnames. HOSTS.TXT was a bottleneck. Once there was HOSTS.TXT. CSCE515 Computer Network Programming. Hierarchical Organization of DNS
Hostnames CSCE 515: Computer Network Programming ------ Address Conversion Function and DNS RFC 1034, RFC 1035 Wenyuan Xu http://www.cse..edu/~wyxu/ce515f07.html Department of Computer Science and Engineering
More informationGoal: learn how to build client/server application that communicate using sockets. An interface between application and network
Socket programming Goal: learn how to build client/server application that communicate using sockets Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server
More informationCS 213, Fall 2000 Lab Assignment L5: Logging Web Proxy Assigned: Nov. 28, Due: Mon. Dec. 11, 11:59PM
CS 213, Fall 2000 Lab Assignment L5: Logging Web Proxy Assigned: Nov. 28, Due: Mon. Dec. 11, 11:59PM Jason Crawford (jasonc@cs.cmu.edu) is the lead person for this assignment. Introduction A web proxy
More informationWhat is CSG150 about? Fundamentals of Computer Networking. Course Outline. Lecture 1 Outline. Guevara Noubir noubir@ccs.neu.
What is CSG150 about? Fundamentals of Computer Networking Guevara Noubir noubir@ccs.neu.edu CSG150 Understand the basic principles of networking: Description of existing networks, and networking mechanisms
More information15-441: Computer Networks Homework 1
15-441: Computer Networks Homework 1 Assigned: September 9 / 2002. Due: September 18 / 2002 in class. In this homework you will run various useful network tools that are available in the Sun/Solaris machines
More informationTFTP Usage and Design. Diskless Workstation Booting 1. TFTP Usage and Design (cont.) CSCE 515: Computer Network Programming ------ TFTP + Errors
CSCE 515: Computer Network Programming ------ TFTP + Errors Wenyuan Xu Department of Computer Science and Engineering University of South Carolina TFTP Usage and Design RFC 783, 1350 Transfer files between
More informationOverview of Computer Networks
Overview of Computer Networks Client-Server Transaction Client process 4. Client processes response 1. Client sends request 3. Server sends response Server process 2. Server processes request Resource
More informationsys socketcall: Network systems calls on Linux
sys socketcall: Network systems calls on Linux Daniel Noé April 9, 2008 The method used by Linux for system calls is explored in detail in Understanding the Linux Kernel. However, the book does not adequately
More informationProject 1: Implement a simple hosts framework using UNIX TCP Sockets to demonstrate the concept of Mobile Agents
Project 1: Implement a simple hosts framework using UNIX TCP Sockets to demonstrate the concept of Mobile Agents Due date: October 15 (Monday), 2007 Requirements This exercise should be done individually.
More informationEthernet. Ethernet. Network Devices
Ethernet Babak Kia Adjunct Professor Boston University College of Engineering ENG SC757 - Advanced Microprocessor Design Ethernet Ethernet is a term used to refer to a diverse set of frame based networking
More informationUnix System Administration
Unix System Administration Chris Schenk Lecture 08 Tuesday Feb 13 CSCI 4113, Spring 2007 ARP Review Host A 128.138.202.50 00:0B:DB:A6:76:18 Host B 128.138.202.53 00:11:43:70:45:81 Switch Host C 128.138.202.71
More informationHow To Write Portable Programs In C
Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important
More informationCommunications and Networking
Communications and Networking History and Background telephone system local area networks Internet architecture: what the pieces are and how they fit together names and addresses: what's your name and
More informationChapter 11. User Datagram Protocol (UDP)
Chapter 11 User Datagram Protocol (UDP) The McGraw-Hill Companies, Inc., 2000 1 CONTENTS PROCESS-TO-PROCESS COMMUNICATION USER DATAGRAM CHECKSUM UDP OPERATION USE OF UDP UDP PACKAGE The McGraw-Hill Companies,
More informationTransport and Network Layer
Transport and Network Layer 1 Introduction Responsible for moving messages from end-to-end in a network Closely tied together TCP/IP: most commonly used protocol o Used in Internet o Compatible with a
More informationTCP/IP Sockets in C. Practical Guide for Programmers
TCP/IP Sockets in C Practical Guide for Programmers The Morgan Kaufmann Practical Guides Series Series Editor: Michael J. Donahoo TCP/IP Sockets in C: Practical Guide for Programmers Michael J. Donahoo
More informationThe TCP/IP Reference Model
The TCP/IP Reference Model The TCP/IP Model Comparison to OSI Model Example Networks The TCP/IP Model Origins from ARPANET, DoD research network ARPA - Advanced Research Projects Agency Reliability was
More informationLecture 7: Introduction to Sockets
Lecture 7: Introduction to Sockets References for Lecture 7: 1) Unix Network Programming, W.R. Stevens, 1990,Prentice-Hall, Chapter 6. 2) Unix Network Programming, W.R. Stevens, 1998,Prentice-Hall, Volume
More informationComputer Networks/DV2 Lab
Computer Networks/DV2 Lab Room: BB 219 Additional Information: http://ti.uni-due.de/ti/en/education/teaching/ss13/netlab Equipment for each group: - 1 Server computer (OS: Windows Server 2008 Standard)
More informationBasic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet
Basic Networking Concepts 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet 1 1. Introduction -A network can be defined as a group of computers and other devices connected
More informationTransport Layer. Chapter 3.4. Think about
Chapter 3.4 La 4 Transport La 1 Think about 2 How do MAC addresses differ from that of the network la? What is flat and what is hierarchical addressing? Who defines the IP Address of a device? What is
More informationThis tutorial has been designed for everyone interested in learning the data exchange features of Unix Sockets.
About the Tutorial Sockets are communication points on the same or different computers to exchange data. Sockets are supported by Unix, Windows, Mac, and many other operating systems. The tutorial provides
More informationBeej's Guide to Network Programming
Beej's Guide to Network Programming Using Internet Sockets Brian Beej Jorgensen Hall beej@beej.us Version 3.0.21 June 8, 2016 Copyright 2015 Brian Beej Jorgensen Hall Thanks to everyone who has helped
More informationUniversity of Amsterdam
University of Amsterdam MSc System and Network Engineering Research Project One Investigating the Potential for SCTP to be used as a VPN Transport Protocol by Joseph Darnell Hill February 7, 2016 Abstract
More informationNote! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages
Part I: The problem specifications NTNU The Norwegian University of Science and Technology Department of Telematics Note! The problem set consists of two parts: Part I: The problem specifications pages
More informationCS3250 Distributed Systems
CS3250 Distributed Systems Lecture 4 More on Network Addresses Domain Name System DNS Human beings (apart from network administrators and hackers) rarely use IP addresses even in their human-readable dotted
More informationTCP/IP Programming. Joel Snyder, Opus1 Geoff Bryant, Process Software
TCP/IP Programming Joel Snyder, Opus1 Geoff Bryant, Process Software Portions Copyright 1996 TGV Software, Inc., Copyright 1996 Process Software Corp. Copyright 1996 Opus1 Course Roadmap Slide 2 NM055
More information