Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Basics of communication LectureII. Processing Techniques.

Similar presentations


Presentation on theme: "The Basics of communication LectureII. Processing Techniques."— Presentation transcript:

1 The Basics of communication LectureII

2 Processing Techniques

3 The Client  Server Model 4 The server roles: –Give service as asked –Wait the client to appeal to him 4 The client roles: –Start the communication process –Asks the wanted service

4 Design considerations 4 Serve single or multiple users 4 Use reliable or unreliable protocol 4 Software updates

5 Client and server roles in UDP 4 Server roles: –Bind a port –Wait for a message to come –Send reply 4 Client roles: –Send a message –Get the reply

6 User Datagram Protocol* 4 Simple protocol 4 Connectionless 4 Unreliable *{RFC 768}

7 Socket:={ip_addr, port number} 4 API, an interface for the program to contact with communication. 4 Enable usage of regular file commands as read, write and so on. 4 The sockets are structures passed from kernel to process and vice versa.

8 What the socket struct contains ? 4 Socket type {stream, dgram, raw,…} 4 Socket options {broadcast, OOB...} 4 Time to linger wait before close the socket 4 Socket state flags 4 Protocol Control Block 4 Protocol Handle

9 The socket & address structs  General struct sockaddr { uint8_tsa_len; /*Len of socket struct */ sa_family_tsa_family; /*Addr family as AF_INET */ charsa_data[20];/*Protocol Address*/  IP V4 address socket struct sockaddr_in { uint8_t sin_len; /*The socket length */ sa_family_tsin_family;/*AF_INET for IP addresses*/ unit16_t sin_port;/*The port id 16-bit port num */ structin_addr sin_addr;/*The IP address 32-bit */ charsin_zero [8]; /* FFU - Must be zero */

10 How the socket is created 4 The system call passes identifiers for address family(e.g. AF_UNIX, AF_INET,etc.), socket type and protocol. 4 Socket data structure is allocated. 4 Pointer from the fd table to other i-node struct which points to the socket.

11 User Datagram Protocol (rfc 768) 4 Data transport layer protocol (Fragment packets to fit local MTU) 4 Used to make available datagram packet switched mode 4 Connectionless protocol 4 Used when RTT is important or no connection needed

12 UDP header Source port number (16 bit) Destination port number (16 bit) Length (16 bit) UDP Checksum (16 bit) Data

13 UDP by network monitor

14 Lets do it in UDP - client C:\TEMP\udp-cli-c.htm

15 Lets do it in UDP - server C:\TEMP\udp-srv-c.html


Download ppt "The Basics of communication LectureII. Processing Techniques."

Similar presentations


Ads by Google