Outline Introduction Function Call Design Outline Introduction Function

  • Slides: 57
Download presentation

Outline • Introduction • Function Call • Design

Outline • Introduction • Function Call • Design

Outline • Introduction • Function Call • Design

Outline • Introduction • Function Call • Design

Function Call • IPv 4 socket定址結構 struct sockaddr_in { sa_family_t sin_family; unsigned short int

Function Call • IPv 4 socket定址結構 struct sockaddr_in { sa_family_t sin_family; unsigned short int sin_port; struct in_addr sin_addr; }; 結構成員 說明 sin_family 用來說明socket所使用的定址模式,在此必須設為AF_INET, 表示internet domain的socket。 sin_port 用來表示TCP/IP的port umber,設定sin_port必需使用htons函 數作位元排序的動作。 sin_addr 是一個in_addr的結構變數,用來表示ip位址。

Function Call (cont. ) • IPv 4 socket定址結構 – Ex: #include <sys/socket. h> #include

Function Call (cont. ) • IPv 4 socket定址結構 – Ex: #include <sys/socket. h> #include <netinet/in. h> #include <arpa/inet. h> struct sockaddr_in adr_srvr; adr_srvr. sin_family = AF_INET; adr_srvr. sin_addr. s_addr = inet_addr("192. 168. 1. 100"); //adr_srvr. sin_addr. s_addr = inet_addr(INADDR_ANY); adr_srvr. sin_port = htons(8000);

Function Call (cont. ) • socket() – Ex: #include <sys/types. h> #include <sys/socket. h>

Function Call (cont. ) • socket() – Ex: #include <sys/types. h> #include <sys/socket. h> Int sockfd; sockfd = Socket(AF_INET, SOCK_STREAM, 0); 傳回值: 成功:傳回socket ID。 失敗:傳回-1。

Function Call (cont. ) port type 說明 20 TCP FTP - data port Official

Function Call (cont. ) port type 說明 20 TCP FTP - data port Official 21 TCP FTP - control (command) port Official 22 TCP SSH (Secure Shell) - used for secure logins, file transfers (scp, sftp) and port forwarding Official 23 TCP Telnet protocol - unencrypted text communications Official 25 TCP SMTP - used for e-mail routing between mailservers E-mails Official 53 TCP DNS (Domain Name System) Official 80 TCP HTTP (Hyper. Text Transfer Protocol) - used for transferring web pages Official 80 TCP HTTP - HTTP listening port Official 110 TCP POP 3 (Post Office Protocol version 3) - used for sending/retrieving E-mails 137 TCP Net. BIOS Name Service Official 138 TCP Net. BIOS Datagram Service Official 139 TCP Net. BIOS Session Service Official

Function Call (cont. ) port type 說明 20 UDP FTP - data port Official

Function Call (cont. ) port type 說明 20 UDP FTP - data port Official 21 UDP FTP - control (command) port Official 22 UDP SSH (Secure Shell) - used for secure logins, file transfers (scp, sftp) and port forwarding Official 23 UDP Telnet protocol - unencrypted text communications Official 25 UDP SMTP - used for e-mail routing between mailservers E-mails Official 53 UDP DNS (Domain Name System) Official 67 UDP BOOTP (Boot. Strap Protocol) server; also used by DHCP (Dynamic Host Configuration Protocol) Official 137 UDP Net. BIOS Name Service Official 138 UDP Net. BIOS Datagram Service Official 139 UDP Net. BIOS Session Service Official

Function Call (cont. ) • 將IPv 4 socket定址結構連結到所建立的 socket • int bind(int sockfd, const

Function Call (cont. ) • 將IPv 4 socket定址結構連結到所建立的 socket • int bind(int sockfd, const struct sockaddr *my_addr, size_t adr_len); 引數 說明 sockfd socket函數執行後傳回的socket ID my_addr 指向socket sockaddr_in結構的指標,用來存放連結的 IPv 4定址結構 adr_len struct sockaddr_in結構的長度,可將其指定為 sizeof(struct sockaddr_in)

Function Call (cont. ) • bind() – Ex: #include <sys/socket. h> bind(sockfd, (struct sockaddr*)&adr_srvr,

Function Call (cont. ) • bind() – Ex: #include <sys/socket. h> bind(sockfd, (struct sockaddr*)&adr_srvr, sizeof(struct sockaddr)); 傳回值: 成功:傳回 0。 失敗:傳回-1。

Function Call (cont. ) • listen() – Ex: #include <sys/socket. h> Int num =

Function Call (cont. ) • listen() – Ex: #include <sys/socket. h> Int num = 5; listen(sockfd, num); 傳回值: 成功:傳回 0。 失敗:傳回-1。

Function Call (cont. ) • 呼叫accept函數來處理並接受佇列中的連線 請求 • int accept(int socketfd, struct sockaddr *addr,

Function Call (cont. ) • 呼叫accept函數來處理並接受佇列中的連線 請求 • int accept(int socketfd, struct sockaddr *addr, socklen_t addrlen); 引數 說明 sockfd socket函數執行後傳回的socket ID addr 指向struct sockaddr_in結構的指標,用來存放client端的IP address addrlen 存放client IP address變數的長度,初值為sizeof(struct sockaddr_in),accept()執行成功後會回存實際的client ip address長度。

Function Call (cont. ) • accept() – Ex: #include <sys/socket. h> accept(sockfd, (struct sockaddr*)&adr_srvr,

Function Call (cont. ) • accept() – Ex: #include <sys/socket. h> accept(sockfd, (struct sockaddr*)&adr_srvr, (struct sockaddr*)&sizeof(adr_srvr)); 傳回值: 成功:傳回client的socket ID,稱為connect socket 。 失敗:傳回-1。

Function Call (cont. ) • 用connect()函數向server端要求建立連線 • int connect(int sockfd, struct sockaddr *serv_addr, int

Function Call (cont. ) • 用connect()函數向server端要求建立連線 • int connect(int sockfd, struct sockaddr *serv_addr, int addrlen); 引數 說明 sockfd socket函數執行後傳回的socket ID serv_addr 指向struct sockaddr_in結構的指標,用來存放server的 address 1 addrlen struct sockaddr_in結構的長度,可指定為sizeof(struct sockaddr_in)

Function Call (cont. ) • connect() – Ex: #include <sys/socket. h> connect(sockfd, (struct sockaddr*)&adr_srvr,

Function Call (cont. ) • connect() – Ex: #include <sys/socket. h> connect(sockfd, (struct sockaddr*)&adr_srvr, (struct sockaddr*)&sizeof(adr_srvr)); 傳回值: 成功:傳回 0。 失敗:傳回-1。

Function Call (cont. ) • write() – Ex: #include <sys/socket. h> Char buf[MAX_PATH] =

Function Call (cont. ) • write() – Ex: #include <sys/socket. h> Char buf[MAX_PATH] = “Hello. World”; write(sockfd, buf, sizeof(buf)); 傳回值: 成功:傳回寫入的字元數。 失敗:傳回-1。

Function Call (cont. ) • read() – Ex: #include <sys/socket. h> Char buf[MAX_PATH]; read(sockfd,

Function Call (cont. ) • read() – Ex: #include <sys/socket. h> Char buf[MAX_PATH]; read(sockfd, buf, sizeof(buf)); 傳回值: 成功:傳回接收的字元數。 失敗:傳回-1。

Function Call (cont. ) • 從已經開啟的socket傳送資料 • int send(int sockfd, const void *msg, int

Function Call (cont. ) • 從已經開啟的socket傳送資料 • int send(int sockfd, const void *msg, int len, unsigned int flags); flags 引數 說明 MSG_OOB 接收的資料以out-of-band送出 MSG_DONTROUTE 取消route的�詢 MSG_DONTWAIT 傳送過程不可以被阻斷 MSG_NOSIGNAL 傳送動作不會因SIGPIPE訊號中斷

Function Call (cont. ) • send() – Ex: #include <sys/types. h> #include <sys/socket. h>

Function Call (cont. ) • send() – Ex: #include <sys/types. h> #include <sys/socket. h> Char buf[MAX_PATH] = “Hello. World”; send(sockfd, buf, sizeof(buf), 0); 傳回值: 成功:傳回傳送的字元數。 失敗:傳回-1。

Function Call (cont. ) • 從已經開啟的socket接收資料 • int recv(int sockfd, const void *msg, int

Function Call (cont. ) • 從已經開啟的socket接收資料 • int recv(int sockfd, const void *msg, int len, unsigned int flags); flags 引數 說明 MSG_OOB 接收以out-of-band送來的資料 MSG_PEEK 遠端socket傳來的資料,不會在接收受刪除 MSG_WAITALL 固定接收len引數指定長度的資料,除非有錯誤或訊號發生 MSG_NOSIGNAL 接收動作不會因SIGPIPE訊號中斷

Function Call (cont. ) • recv() – Ex: #include <sys/types. h> #include <sys/socket. h>

Function Call (cont. ) • recv() – Ex: #include <sys/types. h> #include <sys/socket. h> Char buf[MAX_PATH]; recv(sockfd, buf, sizeof(buf), 0); 傳回值: 成功:傳回接收的字元數。 失敗:傳回-1。

Function Call (cont. ) • 呼叫close()終止client端和server端的連線。 • int close(int sockfd); 引數 說明 sockfd socket函數執行後傳回的socket

Function Call (cont. ) • 呼叫close()終止client端和server端的連線。 • int close(int sockfd); 引數 說明 sockfd socket函數執行後傳回的socket ID

Function Call (cont. ) • close() – Ex: #include <unistd. h> int close(int sockfd);

Function Call (cont. ) • close() – Ex: #include <unistd. h> int close(int sockfd); 傳回值: 成功:傳回 0。 失敗:傳回-1。

Outline • Introduction • Function Call • Design

Outline • Introduction • Function Call • Design

Client - Server Communication Server Stream (e. g. TCP) socket() Unix Datagram (e. g.

Client - Server Communication Server Stream (e. g. TCP) socket() Unix Datagram (e. g. UDP) Client Server socket() bind() Client listen() accept() synchronization point connect() recv() send() recvfrom() sendto() send() recv() sendto() recvfrom() close() Tutorial by Eleftherios Kosmas CS 556 - Distributed Systems 33

■ int Q Q ■ Exchanging data with stream socket count = send(sockid, msg.

■ int Q Q ■ Exchanging data with stream socket count = send(sockid, msg. Len, flags); msg: const void[], message to be transmitted msg. Len: integer, length of message (in bytes) to transmit flags: integer, special options, usually just 0 count: # bytes transmitted (-1 if error) int count = recv(sockid, recv. Buf, buf. Len, flags); Q Q recv. Buf: void[], stores received bytes buf. Len: # bytes received flags: integer, special options, usually just 0 count: # bytes received (-1 if error) ■ Calls are blocking Q returns only after data is sent / received CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas 34

■ Exchanging data with datagram socketmsg, msg. Len, flags, int count = sendto(sockid, &foreign.

■ Exchanging data with datagram socketmsg, msg. Len, flags, int count = sendto(sockid, &foreign. Addr, addrlen); Q Q Q ■ int count = recvfrom(sockid, recv. Buf, buf. Len, flags, &client. Addr, addrlen); Q Q Q ■ msg, msg. Len, flags, count: same with send() foreign. Addr: struct sockaddr, address of the destination addr. Len: sizeof(foreign. Addr) recv. Buf, buf. Len, flags, count: same with recv() client. Addr: struct sockaddr, address of the client addr. Len: sizeof(client. Addr) Calls are blocking Q returns only after data is sent / received CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas 35

Example - Echo ■ ■ A client communicates with an “echo” server The server

Example - Echo ■ ■ A client communicates with an “echo” server The server simply echoes whatever it receives back to the client CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas 36

Example - Echo using stream socket The server starts by getting ready to receive

Example - Echo using stream socket The server starts by getting ready to receive client connections… Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection CS 556 - Distributed Systems Server 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. Accept new connection b. Communicate c. Close the connection Tutorial by Eleftherios Kosmas 37

Example - Echo using stream socket /* Create socket for incoming connections */ if

Example - Echo using stream socket /* Create socket for incoming connections */ if ((serv. Sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) Die. With. Error("socket() failed"); Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 38

Example - Echo using stream socket Client 1. 2. 3. 4. Create a TCP

Example - Echo using stream socket Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection CS 556 - Distributed Systems Server 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. Accept new connection b. Communicate c. Close the connection Tutorial by Eleftherios Kosmas 39

Example - Echo using stream socket /* Mark the socket so it will listen

Example - Echo using stream socket /* Mark the socket so it will listen for incoming connections */ if (listen(serv. Sock, MAXPENDING) < 0) Die. With. Error("listen() failed"); Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection CS 556 - Distributed Systems Server 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. Accept new connection b. Communicate c. Close the connection Tutorial by Eleftherios Kosmas 40

Example - Echo using stream socket for (; ; ) /* Run forever */

Example - Echo using stream socket for (; ; ) /* Run forever */ { clnt. Len = sizeof(echo. Clnt. Addr); if ((client. Sock=accept(serv. Sock, (struct sockaddr *)&echo. Clnt. Addr, &clnt. Len))<0) Die. With. Error("accept() failed"); . . . Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 41

Example - Echo using stream socket Server is now blocked waiting for connection from

Example - Echo using stream socket Server is now blocked waiting for connection from a client … A client decides to talk to the server Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 42

Example - Echo using stream socket /* Create a reliable, stream socket using TCP

Example - Echo using stream socket /* Create a reliable, stream socket using TCP */ if ((client. Sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) Die. With. Error("socket() failed"); Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 43

Example - Echo using stream socket echo. Serv. Addr. sin_family = AF_INET; echo. Serv.

Example - Echo using stream socket echo. Serv. Addr. sin_family = AF_INET; echo. Serv. Addr. sin_addr. s_addr = inet_addr(echoserv. IP); echo. Serv. Addr. sin_port = htons(echo. Serv. Port); /* Internet address family */ /* Server IP address*/ /* Server port */ if (connect(client. Sock, (struct sockaddr *) &echo. Serv. Addr, sizeof(echo. Serv. Addr)) < 0) Die. With. Error("connect() failed"); Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 44

Example Echo using stream socket Server’s accept procedure in now unblocked and returns client’s

Example Echo using stream socket Server’s accept procedure in now unblocked and returns client’s socket for (; ; ) /* Run forever */ { clnt. Len = sizeof(echo. Clnt. Addr); if ((client. Sock=accept(serv. Sock, (struct sockaddr *)&echo. Clnt. Addr, &clnt. Len))<0) Die. With. Error("accept() failed"); . . . Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 45

Example - Echo using stream socket /* Determine input length */ echo. String. Len

Example - Echo using stream socket /* Determine input length */ echo. String. Len = strlen(echo. String); /* Send the string to the server */ if (send(client. Sock, echo. String. Len, 0) != echo. String. Len) Die. With. Error("send() sent a different number of bytes than expected"); Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 46

Example - Echo using stream socket /* Receive message from client */ if ((recv.

Example - Echo using stream socket /* Receive message from client */ if ((recv. Msg. Size = recv(clnt. Socket, echo. Buffer, RCVBUFSIZE, 0)) < 0) Die. With. Error("recv() failed"); /* Send received string and receive again until end of transmission */ while (recv. Msg. Size > 0) { /* zero indicates end of transmission */ if (send(client. Socket, echobuffer, recv. Msg. Size, 0) != recv. Msg. Size) Die. With. Error(“send() failed”); if ((recv. Msg. Size = recv(client. Socket, echo. Buffer, RECVBUFSIZE, 0)) < 0) Die. With. Error(“recv() failed”); } Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 47

Example - Echo using stream socket Similarly, the client receives the data from the

Example - Echo using stream socket Similarly, the client receives the data from the server Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 48

Example - Echo using stream socket close(client. Sock); Server Client 1. 2. 3. 4.

Example - Echo using stream socket close(client. Sock); Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection CS 556 - Distributed Systems 49

Example - Echo using stream socket Server is now blocked waiting for connection from

Example - Echo using stream socket Server is now blocked waiting for connection from a client … Server Client 1. 2. 3. 4. Create a TCP socket Establish connection Communicate Close the connection 1. 2. 3. 4. Create a TCP socket Assign a port to socket Set socket to listen Repeatedly: a. b. c. CS 556 - Distributed Systems Tutorial by Eleftherios Kosmas Accept new connection Communicate Close the connection 50

Example - Echo using datagram socket /* Create socket for sending/receiving datagrams */ if

Example - Echo using datagram socket /* Create socket for sending/receiving datagrams */ if ((serv. Sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) Die. With. Error("socket() failed"); /* Create a datagram/UDP socket */ if ((client. Sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) Die. With. Error("socket() failed"); Server Client 1. 2. 3. 4. Create a UDP socket Assign a port to socket Communicate Close the socket CS 556 - Distributed Systems Create a UDP socket Assign a port to socket Repeatedly 1. 2. 3. ▪ Tutorial by Eleftherios Kosmas Communicate 51

Example - Echo using datagram socket echo. Client. Addr. sin_family = AF_INET; echo. Client.

Example - Echo using datagram socket echo. Client. Addr. sin_family = AF_INET; echo. Client. Addr. sin_addr. s_addr = htonl(INADDR_ANY); echo. Client. Addr. sin_port = htons(echo. Client. Port); /* Internet address family */ /* Any incoming interface */ /* Local port */ if(bind(client. Sock, (struct sockaddr *)&echo. Client. Addr, sizeof(echo. Client. Addr))<0) Die. With. Error("connect() failed"); Client 1. 2. 3. 4. Server Create a UDP socket Assign a port to socket Communicate Close the socket CS 556 - Distributed Systems Create a UDP socket 1. Assign a port to socket Repeatedly 2. 3. ▪ Tutorial by Eleftherios Kosmas Communicate 52

Example - Echo using datagram socket echo. Serv. Addr. sin_family = AF_INET; echo. Serv.

Example - Echo using datagram socket echo. Serv. Addr. sin_family = AF_INET; echo. Serv. Addr. sin_addr. s_addr = inet_addr(echoserv. IP); echo. Serv. Addr. sin_port = htons(echo. Serv. Port); echo. String. Len = strlen(echo. String); /* Internet address family */ /* Server IP address*/ /* Server port */ /* Determine input length */ /* Send the string to the server */ if (sendto( client. Sock, echo. String. Len, 0, (struct sockaddr *) &echo. Serv. Addr, sizeof(echo. Serv. Addr)) != echo. String. Len) Die. With. Error("send() sent a different number of bytes than expected"); Client 1. 2. 3. 4. Server Create a UDP socket Assign a port to socket Communicate Close the socket CS 556 - Distributed Systems Create a UDP socket 1. Assign a port to socket Repeatedly 2. 3. ▪ Tutorial by Eleftherios Kosmas Communicate 53

Example - Echo using datagram socket for (; ; ) /* Run forever */

Example - Echo using datagram socket for (; ; ) /* Run forever */ { client. Addr. Len = sizeof(echo. Client. Addr) /*Block until receive message from client*/ /* Set the size of the in-out parameter */ if ((recv. Msg. Size = recvfrom(serv. Sock, echo. Buffer, ECHOMAX, 0), (struct sockaddr *) &echo. Client. Addr, sizeof(echo. Client. Addr))) < 0) Die. With. Error(“recvfrom() failed"); if (sendto(serv. Sock, echobuffer, recv. Msg. Size, 0, (struct sockaddr *) &echo. Client. Addr, sizeof(echo. Client. Addr)) != recv. Msg. Size) Die. With. Error(“send() failed”); } Client 1. 2. 3. 4. Server Create a UDP socket Assign a port to socket Communicate Close the socket CS 556 - Distributed Systems Create a UDP socket Assign a port to socket Repeatedly 1. 2. 3. ▪ Tutorial by Eleftherios Kosmas Communicate 54

Example - Echo using datagram socket Similarly, the client receives the data from the

Example - Echo using datagram socket Similarly, the client receives the data from the server Client 1. 2. 3. 4. Server Create a UDP socket Assign a port to socket Communicate Close the socket CS 556 - Distributed Systems Create a UDP socket Assign a port to socket Repeatedly 1. 2. 3. ▪ Tutorial by Eleftherios Kosmas Communicate 55

Example - Echo using close(client. Sock); datagram sock et Client 1. 2. 3. 4.

Example - Echo using close(client. Sock); datagram sock et Client 1. 2. 3. 4. Server Create a UDP socket Assign a port to socket Communicate Close the socket CS 556 - Distributed Systems Create a UDP socket 1. Assign a port to socket Repeatedly 2. 3. ▪ Tutorial by Eleftherios Kosmas Communicate 56

Client - Server Communication Server Stream (e. g. TCP) socket() Unix Datagram (e. g.

Client - Server Communication Server Stream (e. g. TCP) socket() Unix Datagram (e. g. UDP) Client Server socket() bind() Client listen() accept() synchronization point connect() recv() send() recvfrom() sendto() send() recv() sendto() recvfrom() close() Tutorial by Eleftherios Kosmas CS 556 - Distributed Systems 57