Computer Networks Chapter 1: Foundation

Slides:



Advertisements
Similar presentations
1 Chapter 1 Foundation Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Copyright © 2010, Elsevier Inc. All rights Reserved.
Advertisements

1 Chapter 1 Foundation Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Copyright © 2010, Elsevier Inc. All rights Reserved.
Spring 2000CS 4611 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics.
KOM 15032: Arsitektur Jaringan Terkini
Spring 2003CS 4611 Introduction, Continued COS 461.
Socket Programming Application Programming Interface.
Network Architectures Professor Jinhua Guo CIS 527 Fall 2002.
Chapter 2 Network Models.
Spring 2004 EE4272 EE4272: Computer Networks Instructor: Dr. Tricia Chigan Dept.: Elec. & Comp. Eng.
Socket Programming.
CIS 527 Computer Networks Introduction Professor Jinhua Guo (updated version) Fall 2003.
Foundation Outline Requirements Network Architecture Implementing Network Software.
1 Java Networking – Part I CS , Spring 2008/9.
Spring 2003CS 4611 Welcome to COS 461 Vivek Pai. Spring 2003CS 4612 Mechanics First time teaching 461 –But have been doing some level of networking for.
Protocols and the TCP/IP Suite
CSE/EE 461 Getting Started with Networking. Basic Concepts  A PROCESS is an executing program somewhere.  Eg, “./a.out”  A MESSAGE contains information.
1/20 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues.
Gursharan Singh Tatla Transport Layer 16-May
Lecture 1, 1Spring 2003, COM1337/3501Computer Communication Networks Rajmohan Rajaraman COM1337/3501 Textbook: Computer Networks: A Systems Approach, L.
Protocols and the TCP/IP Suite Chapter 4. Multilayer communication. A series of layers, each built upon the one below it. The purpose of each layer is.
Process-to-Process Delivery:
Fall 2009COSC 6501 Welcome to COSC650 Towson University Yanggon Kim.
The University of Adelaide, School of Computer Science
1 Introduction to Computer Networks Foundation Ilam University Mozafar Bag-Mohammadi.
Fall 2000Datacom 11 Socket Programming Review Examples: Client and Server-Diagnostics UDP versus TCP Echo.
Fall 2000Datacom 11 Lecture 4 Socket Interface Programming: Service Interface between Applications and TCP.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Review: – computer networks – topology: pair-wise connection, point-to-point networks and broadcast networks – switching techniques packet switching and.
Lecture 2 TCP/IP Protocol Suite Reference: TCP/IP Protocol Suite, 4 th Edition (chapter 2) 1.
Protocol Layering Chapter 10. Looked at: Architectural foundations of internetworking Architectural foundations of internetworking Forwarding of datagrams.
Protocols and the TCP/IP Suite
1 Chapter 1 Foundation Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Copyright © 2010, Elsevier Inc. All rights Reserved.
1 Chapter 1 OSI Architecture The OSI 7-layer Model OSI – Open Systems Interconnection.
1 Chapter 1 Foundation Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Copyright © 2010, Elsevier Inc. All rights Reserved.
1 The Internet and Networked Multimedia. 2 Layering  Internet protocols are designed to work in layers, with each layer building on the facilities provided.
The Transport Layer application transport network data link physical application transport network data link physical application transport network data.
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
1 Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 3: Sockets.
Distributed Computing A Programmer’s Perspective.
1 Pre-Introduction What is computer network?. 2 Pre-Introduction Suppose you want to build a computer network The question is: –What available technologies.
Fall 2001CS 6401 Introduction to Networking Outline Networking History Statistical Multiplexing Performance Metrics.
Spring 2002CS 4611 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues.
CSS CSS432 Foundation Textbook Ch1 Professor: Munehiro Fukuda.
CSE/EE 461 Getting Started with Networking. 2 Basic Concepts A PROCESS is an executing program somewhere. –Eg, “./a.out” A MESSAGE contains information.
CS 6401 Introduction to Computer Networks 09/21/2010 Outline - UNIX sockets - A simple client-server program - Project 1 - LAN bridges and learning.
Requirements Connectivity Resource Sharing Support for Common Services Performance.
CHAPTER 4 PROTOCOLS AND THE TCP/IP SUITE Acknowledgement: The Slides Were Provided By Cory Beard, William Stallings For Their Textbook “Wireless Communication.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
1 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues.
UNIX Sockets Outline UNIX sockets CS 640.
Performance Metrics & Network Architectures Professor Jinhua Guo CIS 427 Winter 2003.
CSE 331: Introduction to Networks and Security Fall 2000 Instructor: Carl A. Gunter Slide Set 2.
SOCKET PROGRAMMING Presented By : Divya Sharma.
Sockets and Beginning Network Programming
Computer Networks.
Sockets and Beginning Network Programming
Network Architecture Layered system with alternative abstractions available at a given layer.
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
Process-to-Process Delivery:
The University of Adelaide, School of Computer Science
University of Houston Datacom II Lecture 1B Review Dr Fred L Zellner
Introduction and Foundation
Socket Programming Neil Tang 09/08/2008
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
Network Basics and Architectures Neil Tang 09/05/2008
Presentation transcript:

Computer Networks Chapter 1: Foundation

The University of Adelaide, School of Computer Science 20 April 2017 Chapter Outline Applications Requirements Network Architecture Implementing Network Software Performance Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Problems How to build a scalable network that will support different applications? What is a computer network? How is a computer network different from other types of networks? What is a computer network architecture? Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Chapter Goal Exploring the requirements that different applications and different communities place on the computer network Introducing the idea of network architecture Introducing some key elements in implementing Network Software Define key metrics that will be used to evaluate the performance of computer network Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Applications Most people know about the Internet (a computer network) through applications World Wide Web On line game Email Online Social Network Streaming Audio Video File Sharing Instant Messaging … Chapter 2 — Instructions: Language of the Computer

Example of an application A multimedia application including video-conferencing

The University of Adelaide, School of Computer Science 20 April 2017 Application Protocol URL Uniform resource locater http://www.sharecourse.net/sc/index.php?page=courseInfoPage&id=24 HTTP Hyper Text Transfer Protocol TCP Transmission Control Protocol 17 messages for one URL request 6 to find the IP (Internet Protocol) address 3 for connection establishment of TCP 4 for HTTP request and acknowledgement Request: I got your request and I will send the data Reply: Here is the data you requested; I got the data 4 messages for tearing down TCP connection Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Requirements Application Programmer List the services that his application needs: delay bounded delivery of data Network Designer Design a cost-effective network with sharable resources Network Provider List the characteristics of a system that is easy to manage Chapter 2 — Instructions: Language of the Computer

Connectivity Need to understand the following terminologies Link Nodes Point-to-point Multiple access Switched Network Circuit Switched Packet Switched Packet, message Store-and-forward Point-to-point Multiple access

Connectivity Terminologies (contd.) Hosts Switches Spanning tree internetwork Router/gateway Host-to-host connectivity Address Routing Unicast/broadcast/multicast s s s s s (a) A switched network R R R (b) Interconnection of networks

How datagrams are delivered in an Internet ? LAN LAN R R WAN R R LAN LAN R

Cost-Effective Resource Sharing Resource: links and nodes How to share a link? Multiplexing De-multiplexing Switch 1 Switch 2 Multiplexing multiple logical flows over a single physical link

Cost-Effective Resource Sharing Synchronous Time-division Multiplexing (TDM) Time slots/data transmitted in predetermined slots FDM: Frequency Division Multiplexing 4 users Example: FDM frequency time Two simple multiple access control techniques. Each mobile’s share of the bandwidth is divided into portions for the uplink and the downlink. Also, possibly, out of band signaling. As we will see, used in AMPS, GSM, IS-54/136 TDM frequency time

Cost-Effective Resource Sharing Statistical Multiplexing Data is transmitted based on demand of each flow. What is a flow? Packets vs. Messages FIFO, Round-Robin, Priorities (Quality-of-Service (QoS)) Congested? LAN (Local Area Networks) MAN (Metropolitan Area Networks) WAN (Wide Area Networks) Switch 1 Switch 2 A switch multiplexing packets from multiple sources onto one shared link

Support for Common Services Logical Channels Application-to-Application communication path or a pipe Host 1 Application s s s s s Application Host 2 Process communicating over an abstract channel

Common Communication Patterns The University of Adelaide, School of Computer Science 20 April 2017 Common Communication Patterns Client/Server Two types of communication channel Request/Reply Channels Message Stream Channels Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Reliability Network should hide the errors Bits are lost Bit errors (1 to a 0, and vice versa) Burst errors – several consecutive errors Packets are lost (Congestion) Links and Node failures Messages are delayed Messages are delivered out-of-order Third parties eavesdrop Chapter 2 — Instructions: Language of the Computer

Network Architecture Example of a layered network system Application Programs Process-to-process Channels Host-to-Host Connectivity Hardware Example of a layered network system

Network Architecture Application Programs Request/reply Message Stream Channel Channel Host-to-Host Connectivity Hardware Layered system with alternative abstractions available at a given layer

The University of Adelaide, School of Computer Science 20 April 2017 Protocols Protocol defines the interfaces between the layers in the same system and with the layers of peer system Building blocks of a network architecture Each protocol object has two different interfaces service interface: operations on this protocol peer-to-peer interface: messages exchanged with peer Term “protocol” is overloaded specification of peer-to-peer interface module that implements this interface Chapter 2 — Instructions: Language of the Computer

Peer-to-peer interface Interfaces Host 1 Host 2 High-level object High-level object Service interface Service interface Protocol Protocol Peer-to-peer interface Service and Peer Interfaces

The University of Adelaide, School of Computer Science 20 April 2017 Protocols Protocol Specification: prose, pseudo-code, state transition diagram Interoperable: when two or more protocols that implement the specification accurately IETF: Internet Engineering Task Force Chapter 2 — Instructions: Language of the Computer

Protocol Graph Example of a protocol graph FTP Web Video FTP Web Video TCP UDP TCP UDP IP IP Example of a protocol graph nodes are the protocols and links the “depends-on” relation

High-level messages are encapsulated inside of low-level messages Encapsulation Application program Application program Data Data TCP TCP TCP Data TCP Data IP IP TCP Data IP High-level messages are encapsulated inside of low-level messages

OSI – Open Systems Interconnection OSI Architecture Application Application Presentation Presentation Session Session Transport Transport Network Network Network Network Data Link Data Link Data Link Data Link Physical Physical Physical Physical The OSI 7-layer Model OSI – Open Systems Interconnection

The University of Adelaide, School of Computer Science 20 April 2017 Description of Layers Physical Layer Handles the transmission of raw bits over a communication link Data Link Layer Collects a stream of bits into a larger aggregate called a frame Network adaptor along with device driver in OS implement the protocol in this layer Frames are actually delivered to hosts Network Layer Handles routing among nodes within a packet-switched network Unit of data exchanged between nodes in this layer is called a packet The lower three layers are implemented on all network nodes Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Description of Layers Transport Layer Implements a process-to-process channel Unit of data exchanges in this layer is called a message Session Layer Provides a name space that is used to tie together the potentially different transport streams that are part of a single application Presentation Layer Concerned about the format of data exchanged between peers Application Layer Standardize common type of exchanges The transport layer and the higher layers typically run only on end-hosts and not on the intermediate switches and routers Chapter 2 — Instructions: Language of the Computer

Internet Architecture FTP HTTP DNS SNMP Application TCP UDP TCP UDP IP Subnetwork IP Alternative view of the Internet architecture. The “Network” layer shown here is sometimes referred to as the “sub-network” or “link” layer. Net1 Net2 ….. Netn Internet Protocol Graph

Internet Architecture The University of Adelaide, School of Computer Science 20 April 2017 Internet Architecture Defined by IETF Three main features Does not imply strict layering. The application is free to bypass the defined transport layers and to directly use IP or other underlying networks An hour-glass shape – wide at the top, narrow in the middle and wide at the bottom. IP serves as the focal point for the architecture In order for a new protocol to be officially included in the architecture, there needs to be both a protocol specification and at least one (and preferably two) representative implementations of the specification Chapter 2 — Instructions: Language of the Computer

Application Programming Interface The University of Adelaide, School of Computer Science 20 April 2017 Application Programming Interface Interface exported by the network Since most network protocols are implemented in software and nearly all computer systems implement their network protocols as part of the operating system, when we refer to the interface “exported by the network”, we are generally referring to the interface that the OS provides to its networking subsystem The interface is called the network Application Programming Interface (API) Chapter 2 — Instructions: Language of the Computer

Application Programming Interface (Sockets) The University of Adelaide, School of Computer Science 20 April 2017 Application Programming Interface (Sockets) Socket Interface was originally provided by the Berkeley distribution of Unix - Now supported in virtually all operating systems Each protocol provides a certain set of services, and the API provides a syntax by which those services can be invoked in this particular OS Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Socket What is a socket? The point where a local application process attaches to the network An interface between an application and the network An application creates the socket The interface defines operations for Creating a socket Attaching a socket to the network Sending and receiving messages through the socket Closing the socket Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Socket Socket Family PF_INET denotes the Internet family PF_UNIX denotes the Unix pipe facility PF_PACKET denotes direct access to the network interface (i.e., it bypasses the TCP/IP protocol stack) Socket Type SOCK_STREAM is used to denote a byte stream SOCK_DGRAM is an alternative that denotes a message oriented service, such as that provided by UDP Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Creating a Socket int sockfd = socket(address_family, type, protocol); The socket number returned is the socket descriptor for the newly created socket int sockfd = socket (PF_INET, SOCK_STREAM, 0); int sockfd = socket (PF_INET, SOCK_DGRAM, 0); The combination of PF_INET and SOCK_STREAM implies TCP Chapter 2 — Instructions: Language of the Computer

Client-Serve Model with TCP The University of Adelaide, School of Computer Science 20 April 2017 Client-Serve Model with TCP Server Passive open Prepares to accept connection, does not actually establish a connection Server invokes int bind (int socket, struct sockaddr *address, int addr_len) int listen (int socket, int backlog) int accept (int socket, struct sockaddr *address, int *addr_len) Chapter 2 — Instructions: Language of the Computer

Client-Serve Model with TCP The University of Adelaide, School of Computer Science 20 April 2017 Client-Serve Model with TCP Bind Binds the newly created socket to the specified address i.e. the network address of the local participant (the server) Address is a data structure which combines IP and port Listen Defines how many connections can be pending on the specified socket Chapter 2 — Instructions: Language of the Computer

Client-Serve Model with TCP The University of Adelaide, School of Computer Science 20 April 2017 Client-Serve Model with TCP Accept Carries out the passive open Blocking operation Does not return until a remote participant has established a connection When it does, it returns a new socket that corresponds to the new established connection and the address argument contains the remote participant’s address Chapter 2 — Instructions: Language of the Computer

Client-Serve Model with TCP The University of Adelaide, School of Computer Science 20 April 2017 Client-Serve Model with TCP Client Application performs active open It says who it wants to communicate with Client invokes int connect (int socket, struct sockaddr *address, int addr_len) Connect Does not return until TCP has successfully established a connection at which application is free to begin sending data Address contains remote machine’s address Chapter 2 — Instructions: Language of the Computer

Client-Serve Model with TCP The University of Adelaide, School of Computer Science 20 April 2017 Client-Serve Model with TCP In practice The client usually specifies only remote participant’s address and let’s the system fill in the local information Whereas a server usually listens for messages on a well-known port (port 80 for http) A client does not care which port it uses for itself, the OS simply selects an unused one Chapter 2 — Instructions: Language of the Computer

Client-Serve Model with TCP The University of Adelaide, School of Computer Science 20 April 2017 Client-Serve Model with TCP Once a connection is established, the application process invokes two operation int send (int socket, char *msg, int msg_len, int flags) int recv (int socket, char *buff, int buff_len, Chapter 2 — Instructions: Language of the Computer

Example Application: Client The University of Adelaide, School of Computer Science 20 April 2017 Example Application: Client #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #define SERVER_PORT 5432 #define MAX_LINE 256 int main(int argc, char * argv[]) { FILE *fp; struct hostent *hp; struct sockaddr_in sin; char *host; char buf[MAX_LINE]; int s; int len; if (argc==2) { host = argv[1]; } else { fprintf(stderr, "usage: simplex-talk host\n"); exit(1); Chapter 2 — Instructions: Language of the Computer

Example Application: Client The University of Adelaide, School of Computer Science 20 April 2017 Example Application: Client /* translate host name into peer’s IP address */ hp = gethostbyname(host); if (!hp) { fprintf(stderr, "simplex-talk: unknown host: %s\n", host); exit(1); } /* build address data structure */ bzero((char *)&sin, sizeof(sin)); sin.sin_family = AF_INET; bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length); sin.sin_port = htons(SERVER_PORT); /* active open */ if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) { perror("simplex-talk: socket"); if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { perror("simplex-talk: connect"); close(s); /* main loop: get and send lines of text */ while (fgets(buf, sizeof(buf), stdin)) { buf[MAX_LINE-1] = ’\0’; len = strlen(buf) + 1; send(s, buf, len, 0); Chapter 2 — Instructions: Language of the Computer

Example Application: Server The University of Adelaide, School of Computer Science 20 April 2017 Example Application: Server #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #define SERVER_PORT 5432 #define MAX_PENDING 5 #define MAX_LINE 256 int main() { struct sockaddr_in sin; char buf[MAX_LINE]; int len; int s, new_s; /* build address data structure */ bzero((char *)&sin, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = htons(SERVER_PORT); /* setup passive open */ if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) { perror("simplex-talk: socket"); exit(1); } Chapter 2 — Instructions: Language of the Computer

Example Application: Server The University of Adelaide, School of Computer Science 20 April 2017 Example Application: Server if ((bind(s, (struct sockaddr *)&sin, sizeof(sin))) < 0) { perror("simplex-talk: bind"); exit(1); } listen(s, MAX_PENDING); /* wait for connection, then receive and print text */ while(1) { if ((new_s = accept(s, (struct sockaddr *)&sin, &len)) < 0) { perror("simplex-talk: accept"); while (len = recv(new_s, buf, sizeof(buf), 0)) fputs(buf, stdout); close(new_s); Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Performance Bandwidth Width of the frequency band Number of bits per second that can be transmitted over a communication link 1 Mbps: 1 x 106 bits/second = 1x220 bits/sec 1 x 10-6 seconds to transmit each bit or imagine that a timeline, now each bit occupies 1 micro second space. On a 2 Mbps link the width is 0.5 micro second. Smaller the width more will be transmission per unit time. Chapter 2 — Instructions: Language of the Computer

Bandwidth Bits transmitted at a particular bandwidth can be regarded as having some width: (a) bits transmitted at 1Mbps (each bit 1 μs wide); (b) bits transmitted at 2Mbps (each bit 0.5 μs wide).

The University of Adelaide, School of Computer Science 20 April 2017 Performance Latency = Propagation time + transmission time + queuing time Propagation time = distance/speed of light Transmission time = size/bandwidth One bit transmission => propagation is important Large bytes transmission => bandwidth is important Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Delay X Bandwidth We think the channel between a pair of processes as a hollow pipe Latency (delay): length of the pipe Bandwidth: width of the pipe Delay x Bandwidth means how many data can be stored in the pipe For example, delay of 50 ms and bandwidth of 45 Mbps 50 x 10-3 seconds x 45 x 106 bits/second 2.25 x 106 bits = 280 KB data. Network as a pipe Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Delay X Bandwidth Relative importance of bandwidth and latency depends on application For large file transfer, bandwidth is critical For small messages (HTTP, NFS, etc.), latency is critical Variance in latency (jitter) can also affect some applications (e.g., audio/video conferencing) Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Delay X Bandwidth How many bits the sender must transmit before the first bit arrives at the receiver if the sender keeps the pipe full Takes another one-way latency to receive a response from the receiver If the sender does not fill the pipe—send a whole delay × bandwidth product’s worth of data before it stops to wait for a signal—the sender will not fully utilize the network Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 20 April 2017 Delay X Bandwidth Infinite bandwidth RTT dominates Throughput = TransferSize / TransferTime TransferTime = RTT + 1/Bandwidth x TransferSize Its all relative 1-MB file to 1-Gbps link looks like a 1-KB packet to 1-Mbps link Chapter 2 — Instructions: Language of the Computer

Relationship between bandwidth and latency A 1-MB file would fill the 1-Mbps link 80 times, but only fill the 1-Gbps link 1/12 of one time

The University of Adelaide, School of Computer Science 20 April 2017 Summary What we expect from a computer network have been identified A layered architecture for computer network that will serve as a blueprint for our design has been defined The socket interface which will be used by applications for invoking the services of the network subsystem has been discussed Two performance metrics using which we can analyze the performance of computer networks have also been discussed. Chapter 2 — Instructions: Language of the Computer

End of Chapter 1