Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.

Similar presentations


Presentation on theme: "CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina."— Presentation transcript:

1 CSCE 515: Computer Network Programming Chin-Tser Huang huangct@cse.sc.edu University of South Carolina

2 1/15/2004(C) 2004 Chin-Tser Huang2 Layer 7: Application Application Presentation Session Transport Network Data link Physical Each Layer 7 protocol specifies how oneparticular application uses a network.Each protocol specifies how an applicationon one machine makes request and howthe application on another machineresponds.

3 1/15/2004(C) 2004 Chin-Tser Huang3 Layer 6: Presentation Application Presentation Session Transport Network Data link Physical Layer 6 protocols specify how to representdata. They are used to translate from therepresentation on one computer to therepresentation on another computer.

4 1/15/2004(C) 2004 Chin-Tser Huang4 Layer 5: Session Application Presentation Session Transport Network Data link Physical Layer 5 protocols specify how to establish acommunication session with a remotesystem, including specifications for securitydetails such as authentication usingpasswords.

5 1/15/2004(C) 2004 Chin-Tser Huang5 Layer 4: Transport Application Presentation Session Transport Network Data link Physical Layer 4 protocols specify how to providereliable data transfer for differentapplications.

6 1/15/2004(C) 2004 Chin-Tser Huang6 Layer 3: Network Application Presentation Session Transport Network Data link Physical Layer 3 protocols specify how addresses areassigned and how packets are forwardedbetween networks.

7 1/15/2004(C) 2004 Chin-Tser Huang7 Layer 2: Data Link Application Presentation Session Transport Network Data link Physical Layer 2 protocols specify how to organizedata into frames and how to transmitframes over a network.

8 1/15/2004(C) 2004 Chin-Tser Huang8 Layer 1: Physical Application Presentation Session Transport Network Data link Physical Layer 1 protocols specify details ofinteracting with network hardware.

9 1/15/2004(C) 2004 Chin-Tser Huang9 Origin of Internet In the 60’s, US DoD funded ARPANET for testing new network technologies ARPANET was later extended to the Internet Protocol suite used with Internet is Transmission Control Protocol/Internet Protocol (TCP/IP)

10 1/15/2004(C) 2004 Chin-Tser Huang10 TCP/IP Model in Internet Application Presentation Session Transport Network Data link Physical Transport Network Application Link OSI modelTCP/IP model

11 1/15/2004(C) 2004 Chin-Tser Huang11 Transport Layer Protocol: TCP, UDP TCP provides a reliable flow of data between two hosts; including mechanism of connection setup, congestion control, and retransmission UDP provides a simpler service which is unreliable

12 1/15/2004(C) 2004 Chin-Tser Huang12 Client-Server Model Assume one side of communication is client, and the other side is server Server waits for a client request to arrive Server processes the client request and sends the response back to the client Iterative or concurrent

13 1/15/2004(C) 2004 Chin-Tser Huang13 Port Number TCP and UDP identify applications by 16-bit port numbers Some servers are assigned well-known port number For example, ftp is port 21 and telnet is port 23 Clients usually use ephemeral port numbers between 1024 and 5000

14 1/15/2004(C) 2004 Chin-Tser Huang14 Network Layer Protocol: IP, ICMP, IGMP Assign addresses to hosts on the Internet Determine how to forward messages over the Internet

15 1/15/2004(C) 2004 Chin-Tser Huang15 Internet Address Every interface on the Internet has a unique address In IPv4 every address is 32-bit, while in IPv6 every address is 128-bit Usually specified with dotted-decimal notation: written as 4 decimal numbers, one for each byte hadar.cse.sc.edu: 129.252.130.109

16 1/15/2004(C) 2004 Chin-Tser Huang16 Classes of Network Every network belongs to one of five classes, based on first byte in its address hostid 0 10 110 1110multicast group ID 1111reserved netid Class A Class B Class D Class C Class E 724 1416 218 28

17 1/15/2004(C) 2004 Chin-Tser Huang17 Ranges for Different Classes Class A: 0.0.0.0 to 127.255.255.255 Class B: 128.0.0.0 to 191.255.255.255 Class C: 192.0.0.0 to 223.255.255.255 Class D: 224.0.0.0 to 239.255.255.255 Class E: 240.0.0.0 to 255.255.255.255

18 1/15/2004(C) 2004 Chin-Tser Huang18 Domain Name System (DNS) Dotted-decimal addresses are both hard to remember and meaningless Use a structured name for each host For example, hadar.cse.sc.edu DNS is a distributed database providing mapping between IP addresses and hostnames

19 1/15/2004(C) 2004 Chin-Tser Huang19 Header Encapsulation An application sends messages down the protocol stack Each layer adds information to a message by prepending an extra header

20 1/15/2004(C) 2004 Chin-Tser Huang20 Header Encapsulation Link layer header Network layer header Transport layer header User data Transport Network Application Link

21 1/15/2004(C) 2004 Chin-Tser Huang21 Application Programming Interface (API) A set of operations available to an application programmer Two popular APIs Sockets developed at Berkeley X/Open Transport Interface (XTI) developed by AT&T We will focus on sockets

22 1/15/2004(C) 2004 Chin-Tser Huang22 What Is a Socket? An API between applications and network protocol software provided by the OS Provide following functions Define an abstract endpoint for communication Initiate and accept a connection Send and receive data Terminate a connection gracefully

23 1/15/2004(C) 2004 Chin-Tser Huang23 Elements of a Socket Each socket can be uniquely identified by Source IP address Source port number Destination IP address Destination port number An end-to-end protocol (TCP or UDP)

24 1/15/2004(C) 2004 Chin-Tser Huang24 Types of Sockets Two different types of sockets Stream sockets Datagram sockets

25 1/15/2004(C) 2004 Chin-Tser Huang25 Stream Sockets Also known as connection-oriented socket Use TCP Provide reliable, connected networking service Error free; no out-of-order packets Applications: telnet, ssh, http

26 1/15/2004(C) 2004 Chin-Tser Huang26 Datagram Sockets Also known as connectionless socket Use UDP Provide unreliable, best-effort networking service Packets may be lost; may arrive out of order Applications: streaming audio/video

27 1/15/2004(C) 2004 Chin-Tser Huang27 Next Class Socket programming in Java Read JNP Ch. 14, 16


Download ppt "CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina."

Similar presentations


Ads by Google