1 UDP client A sendto Brecv C bind
破冰活動 提供者:黃昭隆、郭惠民 1. UDP client 傳送資料使用什麼函式庫指令 ◦ (A) sendto (B)recv (C) bind (D)recvfrom (E)socket 2. UDP Server Port binding 用什麼函式庫指令 ◦ (A) sendto (B)recv (C) bind (D)recvfrom (E)socket
2. 連連看 (右邊的通訊協定, 各屬於左 邊OSI中的哪一層? 提供者:吳文義、劉炎敦 Application Layer Presentatio n Layer Session Layer Transport Layer Network Layer Data Link Layer Physical Layer SIP SCT P TCP UDP IP
教學目標 教材第三章節的相關學習 ◦ 3. 1 General Issues ◦ 3. 2 Elementary UDP Socket Functions ◦ 3. 3 UDP Client/Server Example 教材第四章節的相關學習 ◦ 4. 1 General Issues ◦ 4. 2 SCTP Feature ◦ 4. 3 Elementary SCTP Socket Functions
Review of Transport Layer Services Connection-Oriented Transport Services ◦ Transmission Control Protocol (TCP) ◦ Stream Control Transmission Protocol (SCTP) Connectionless Transport Services ◦ User Datagram Protocol (UDP)
User Datagram Protocol (UDP) UDP provides an unreliable, connectionless service to the invoking application No handshaking between sending and receiving transport layer entities before sending data segments UDP is defined in RFC 768 (http: //www. ietf. org/rfc 0768. txt) UDP-based Internet Services/Applications: DNS, SNMP, RIP, Internet Telephony
Comparison of UDP and TCP Segments
Categories of UDP Sockets’ Functions
Operations of UDP Client/Server
Operations of SCTP Client/Server
Comparison of TCP and UDP Socket Data Sending and Receiving
Socket library listen() bind() connect() accept() socket() send() recv()
Comparison of TCP and UDP Socket Data Sending and Receiving send( SOCKET s, const void *buf, int len, int flags) recv( SOCKET s, void *buf, int len, int flags) sendto( int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) recvfrom( int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen) sctp_sendmsg( sctp_recvmsg( int s, const void *msg, size_t len, struct sockaddr *to, struct sockaddr *from, socklen_t tolen, socklen_t *fromlen, uint 32_t ppid, struct sctp_sndrcvinfo *sinfo, uint 32_t flags, int *msg_flags) uint 16_t stream_no, uint 32_t timetolive, uint 32_t context);
DEMO UDP SCTP
- Slides: 21