lecture2 - CIS 525/725 Computer Networks Lecture 2: Network...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CIS 525/725 Computer Networks Lecture 2: Network Application Development Mitch Neilsen [email protected] Network Architecture A network architecture is a set of layers and protocols used to reduce network design complexity. The TCP/IP Protocol Suite (also called the Internet Architecture) is an important example of a network architecture. The OSI 7-Layer Reference Model [ISO,1984] is a guide that specifies what each layer should do, but not how each layer is implemented. ISO 7-Layer Reference Model End host Application End host Application Presentation Presentation Session Session Transport Transport Network Network Network Network Data link Data link Data link Data link Physical Physical Physical Physical One or more nodes within the subnetwork Protocols Protocols are the building blocks of a network architecture. Each protocol object has two different interfaces: service interface: operations on this protocol peer-to-peer interface: define the messages exchanged between peers Term "protocol" is overloaded specification of peer-to-peer interface module that implements this interface Interfaces Host 1 Host 2 High-level object Service interface High-level object Protocol Peer-to-peer interface Protocol Network Programming A network allows arbitrary applications to communicate. However, a network programmer doesn't need to know the details of all lower-level network technologies. Network facilities are accessed through an Application Programming Interface (API); e.g., a Service Interface. Protocol Machinery Protocol Graph most peer-to-peer communication is indirect peer-to-peer is direct only at hardware level Host 1 File application Host 2 File application Digital library application Video application Digital library application Video application RRP RTP RRP RTP HHP HHP 7 Machinery (cont) Multiplexing and Demultiplexing (demux key) Encapsulation (header/body) Host 1 Application program Data RRP RRP Data HHP HHP RRP RRP Data Application program Data Host 2 HHP RRP Data 8 Internet Architecture Defined by Internet Engineering Task Force See www.ietf.org (IETF) Hourglass Design FTP HTTP NV TFTP TCP UDP IP NET 1 NET2 ... NETn Performance Metrics Bandwidth (throughput) data transmitted per time unit link versus end-to-end notation KB = 210 bytes Mbps = 106 bits per second GHz = 109 cycles per second Latency (delay) time to send message from point A to point B one-way versus round-trip time (RTT) components Latency = Propagation + Transmit + Queue Propagation = Distance / c Transmit = Size / Bandwidth Bandwidth versus Latency Relative importance 1-byte: 1ms vs 100ms dominates 1Mbps vs 100Mbps 25MB: 1Mbps vs 100Mbps dominates 1ms vs 100ms Infinite bandwidth RTT dominates Throughput = TransferSize / TransferTime TransferTime = RTT + 1/Bandwidth x TransferSize 1-MB file to 1-Gbps link as 1-KB packet to 1-Mbps link Delay x Bandwidth Product Amount of data "in flight" or "in the pipe" Example: 100ms x 45Mbps = 460KB Delay Bandwidth Internet Protocols Internet Protocol Standards appear as a list of technical reports, each called a Request For Comments (RFC). RFCs are readily available on the web. See: www.ietf.org Example: Simple Mail Transfer Protocol (SMTP), RFC 822 and RFC 2821 Simple Mail Transfer Protocol End host End host Application "MAIL FROM: [email protected]" Application Presentation Presentation Session Session Transport Transport Network Network Network Network Data link Data link Data link Data link Physical Physical Physical Physical One or more nodes within the network Client-Server Paradigm Server waits for client to request a connection. Client contacts server to establish a connection. Client sends request. Server sends reply. Client and/or server terminate connection. SMTP Example $ grep mail /etc/services > smtp 25/tcp mail $ ktelnet smtp.ksu.edu 25 HELO smtp.ksu.edu MAIL FROM: <[email protected]> RCPT TO: <[email protected]> DATA Hello, Mitch. . QUIT Echo Example Provides a simple network connectivity test. Server returns (echoes) an exact copy of data sent. Example: $ grep echo /etc/services echo 7/tcp echo 7/udp $ telnet a.cs.okstate.edu 7 Packet InterNet Groper (PING) Ping is an application that can be used to test network level (IP) connectivity. $ ping <hostname> $ ping s <packet size> -c <count> <hostname> $ other versions use: ping s t<TTL> <hostname><packet size><# packets> where TTL = time-to-live, etc. ALWAYS CHECK THE MANUAL PAGES: man ping Example: $ ping www.okstate.edu $ ping s100 c1 t3 www.okstate.edu Domain Name Service Client (nslookup) The Domain Name Service (DNS) can be used to resolve the mapping from a hostname to its assigned IP address; nslookup is a DNS client. Example $ nslookup <hostname> $ nslookup castor.cis.ksu.edu Server: rigel.cis.ksu.edu Address: 129.130.10.65 Name: castor.cis.ksu.edu Address: 129.130.10.16 Network Programming A network allows arbitrary applications to communicate. However, a network programmer doesn't need to know the details of all lower-level network technologies. Network facilities are accessed through an Application Programming Interface (API); e.g., a Service Interface. Service Interface Host 1 Host 2 Application Layer Protocol Application Client Application Server Service interface Transport Service Transport Service Transport Layer Protocol Application Development Steps Understand how processes and threads communicate on a single host (IPC). Understand how data flows between hosts (e.g., using sockets API). Put the two together. Processes and Threads A process is a program in execution, consisting of a program counter, a register set, a stack, data and code segment, and other system resources (open file pointers, etc.). A thread (or lightweight process) is a basic unit of CPU utilization, consisting of a program counter, a register set, and a stack space. User-level threads typically share data and code segments, and other system resources with peer threads in the same process. Process and Thread Models Processes (threads) can be represented graphically in a parent-child hierarchy called a process (thread) model. In UNIX, a child process can be created using the fork( ) system call; new code is executed using the execl( ) system call. Typically, an fexecl( ) system call is available to do both. In Windows, the fork + execute system call is spawnl( ). A child thread can be created by calling the POSIX library pthread_create( ). Process and Thread Models $ ls | more = process = thread ksh pipe ls more Process and Thread Models Inter-Process Communication (on a single host) Shared Files Pipes (e.g., ls | more) Named Pipes Signals Shared Memory Semaphores Monitors etc. Ex5.c: Timeout Using Signals Client data timeout data no timeout ack Server time Summary Outline: Understand communication between threads and processes on a single host (IPC). Understand communication between hosts (using various APIs: Berkeley Sockets, etc.). Put the two together. Understand the underlying theory and protocols. To Do: Read Chapter 1, obtain a CIS account, visit KSU K-State On-line web site for CIS 525, and then "spoof" yourself using telnet or ktelnet. ...
View Full Document

This note was uploaded on 09/06/2009 for the course CIS 21092 taught by Professor Neilsen during the Spring '09 term at Kansas State University.

Ask a homework question - tutors are online