Distributed Systems 2a. Networking Part 2

Similar documents
Operating Systems Design 16. Networking: Sockets

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

Internet Architecture and Philosophy

Network layer" 1DT066! Distributed Information Systems!! Chapter 4" Network Layer!! goals: "

Network layer: Overview. Network layer functions IP Routing and forwarding

Mobile IP Network Layer Lesson 02 TCP/IP Suite and IP Protocol

Internetworking. Problem: There is more than one network (heterogeneity & scale)

Network Layer: Network Layer and IP Protocol

Ethernet. Ethernet. Network Devices

Chapter 4 Network Layer

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

Transport and Network Layer

Lecture Computer Networks

IP - The Internet Protocol

IP addressing and forwarding Network layer

What is CSG150 about? Fundamentals of Computer Networking. Course Outline. Lecture 1 Outline. Guevara Noubir noubir@ccs.neu.

Objectives of Lecture. Network Architecture. Protocols. Contents

How do I get to

8.2 The Internet Protocol

ICT SEcurity BASICS. Course: Software Defined Radio. Angelo Liguori. SP4TE lab.

Tutorial on Socket Programming

Outline. CSc 466/566. Computer Security. 18 : Network Security Introduction. Network Topology. Network Topology. Christian Collberg

Based on Computer Networking, 4 th Edition by Kurose and Ross

Unix System Administration

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

Lectures on distributed systems: Client-server communication. Paul Krzyzanowski

Subnetting,Supernetting, VLSM & CIDR

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

Gary Hecht Computer Networking (IP Addressing, Subnet Masks, and Packets)

Internet Protocols. Addressing & Services. Updated:

Internet Control Protocols Reading: Chapter 3

Network Programming TDC 561

ELEN 602: Computer Communications and Networking. Socket Programming Basics

IP address format: Dotted decimal notation:

Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.

CS 43: Computer Networks IP. Kevin Webb Swarthmore College November 5, 2013

Overview of TCP/IP. TCP/IP and Internet

Technical Support Information Belkin internal use only

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

Network Layer IPv4. Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS. School of Computing, UNF

Efficient Addressing. Outline. Addressing Subnetting Supernetting CS 640 1

Understanding TCP/IP. Introduction. What is an Architectural Model? APPENDIX

Socket Programming. Srinidhi Varadarajan

Networking Test 4 Study Guide

VLAN und MPLS, Firewall und NAT,

Chapter 11. User Datagram Protocol (UDP)

Socket Programming. Request. Reply. Figure 1. Client-Server paradigm

RARP: Reverse Address Resolution Protocol

The internetworking solution of the Internet. Single networks. The Internet approach to internetworking. Protocol stacks in the Internet

Lecture 8. IP Fundamentals

Agenda. Distributed System Structures. Why Distributed Systems? Motivation

Internet Protocols Fall Lectures 7-8 Andreas Terzis

Transport Layer Protocols

Lecture 15. IP address space managed by Internet Assigned Numbers Authority (IANA)

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Introduction to TCP/IP

(Refer Slide Time: 02:17)

Chapter 3: Review of Important Networking Concepts. Magda El Zarki Dept. of CS UC Irvine

Network Programming with Sockets. Process Management in UNIX

The POSIX Socket API

IP Subnetting and Addressing

04 Internet Protocol (IP)

Application Protocols for TCP/IP Administration

Internet Packets. Forwarding Datagrams

Chapter 9. IP Secure

Transport Layer. Chapter 3.4. Think about

Final Exam. Route Computation: One reason why link state routing is preferable to distance vector style routing.

Networking Overview. (as usual, thanks to Dave Wagner and Vern Paxson)

CS335 Sample Questions for Exam #2

HOST AUTO CONFIGURATION (BOOTP, DHCP)

IP Address Classes (Some are Obsolete) Computer Networking. Important Concepts. Subnetting Lecture 8 IP Addressing & Packets

Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme. Auxiliary Protocols

CS 457 Lecture 19 Global Internet - BGP. Fall 2011

Network Security TCP/IP Refresher

UNIX Sockets. COS 461 Precept 1

Introduction to Analyzer and the ARP protocol

iseries TCP/IP routing and workload balancing

Interconnection of Heterogeneous Networks. Internetworking. Service model. Addressing Address mapping Automatic host configuration

Computer Networks/DV2 Lab

Socket Programming. Kameswari Chebrolu Dept. of Electrical Engineering, IIT Kanpur

Firewall Implementation

TCP Performance Management for Dummies

>>> SOLUTIONS <<< c) The OSI Reference Model has two additional layers. Where are these layers in the stack and what services do they provide?

Introduction to Socket Programming Part I : TCP Clients, Servers; Host information

ACHILLES CERTIFICATION. SIS Module SLS 1508

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

Asynchronous Transfer Mode: ATM. ATM architecture. ATM: network or link layer? ATM Adaptation Layer (AAL)

Mobile Routing. When a host moves, its point of attachment in the network changes. This is called a handoff.

Internetworking and Internet-1. Global Addresses

2. IP Networks, IP Hosts and IP Ports

Protocols. Packets. What's in an IP packet

DHCP, ICMP, IPv6. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley DHCP. DHCP UDP IP Eth Phy

Computer Networks. Chapter 5 Transport Protocols

Exercises TCP/IP Networking. Solution. With Solutions

Unix Network Programming

The Internet. Internet Technologies and Applications

Internet Protocols. Background CHAPTER

Dynamic Host Configuration Protocol (DHCP) 02 NAT and DHCP Tópicos Avançados de Redes

Transcription:

Distributed Systems 2a. Networking Part 2 Paul Krzyzanowski pxk@cs.rutgers.edu 9/30/2011 1

Networks Packet versus Circuit switching Baseband versus Broadband Ethernet CSMA/CD Layers of protocols Data Link (2) versus Network (3) versus Transport (4) Communication protocols Connection-oriented (virtual circuit) Connectionless (datagram) 9/30/2011 2

IP Networking IP addressing Network-Host partitioning Class-based addressing Classless Inter-Domain Routing (CIDR) Transport layer protocols: TCP & UDP Port numbers Packet encapsulation Ethernet IP TCP/UDP Why would you ever use UDP? 9/30/2011 3

Routing Packets take a series of hops to get to their destination Figure out the path Generate/receive packet at machine check destination else If destination = local address, deliver locally Increment hop count (discard if hop # = TTL) Use destination address to search routing table Each entry has address and netmask. Match returns interface Transmit to destination interface Static routing 9/30/2011 4

Routing Dynamic routing Class of protocols by which machines can adjust routing tables to benefit from load changes and failures E.g., RIP (routed), OSPF Router Switching element that connects two or more network interfaces Operates at layer 3 (network) does not extend a LAN 9/30/2011 5

Transport-layer protocols over IP IP sends packets to machine No mechanism for identifying sending or receiving application Transport layer uses port number to identify application TCP Transmission Control Protocol UDP User Datagram Protocol 9/30/2011 6

TCP Transmission Control Protocol Virtual circuit service (connection-oriented) Send acknowledgement for each received packet Checksum to validate data Data may be transmitted simultaneously in both directions 9/30/2011 7

UDP User Datagram Protocol Datagram service (connectionless) Data may be lost Data may arrive out of sequence Checksum for data but no retransmission Bad packets dropped 9/30/2011 8

Programming Interfaces 9/30/2011 9

Sockets IP lets us send data between machines TCP & UDP are transport layer protocols Contain port number to identify transport endpoint (application) The most popular abstraction for transport layer connectivity: sockets Developed at UC Berkeley 9/30/2011 10

Sockets Attempt at generalized IPC model Goals: communication between processes should not depend on whether they are on the same machine efficiency compatibility support different protocols and naming conventions 9/30/2011 11

Socket Abstract object from which messages are sent and received Looks like a file descriptor Application can select particular style of communication Virtual circuit, datagram, message-based, in-order delivery Unrelated processes should be able to locate communication endpoints Sockets can have a name Name should be meaningful in the communications domain 9/30/2011 12

The OS Interface to Sockets 9/30/2011 13

Step 1 Create a socket int s = socket(domain, type, protocol) AF_INET SOCK_STREAM SOCK_DGRAM useful if some families have more than one protocol to support a given service Conceptually similar to open BUT - open creates a new reference to a possibly existing object - socket creates a new instance of an object 9/30/2011 14

Step 2 Name the socket (assign address, port) int error = bind(s, addr, addrlen) socket Address structure struct sockaddr* length of address structure 9/30/2011 15

Step 3a (server) Set socket to be able to accept connections int error = listen(s, backlog) socket queue length for pending connections 9/30/2011 16

Step 3b (server) Wait for a connection from client int snew = accept(s, clntaddr, &clntalen) new socket for this session socket pointer to address structure length of address structure s is only used for managing the queue of connection requests 9/30/2011 17

Step 3 (client) Connect to server int error = connect(s, svraddr, svraddrlen) socket address structure struct sockaddr* length of address structure 9/30/2011 18

Step 4 Exchange data Connection-oriented read/write recv/send (extra flags) Connectionless sendto/recvfrom sendmsg/recvmsg 9/30/2011 19

Step 5 Close connection shutdown(s, how) how: 0: can send but not receive 1: cannot send more data 2: cannot send or receive (=0+1) 9/30/2011 20

Programming: sockets Connection-oriented Connectionless socket bind listen accept connect read/write shutdown/close socket bind sendmsg/recvmsg close 9/30/2011 21

Data Flow Between the Wire & App from socket to socket System call Interface Generic network interface TCP driver UDP driver IP driver Abstract Device Interface Network Device Driver from wire to wire 9/30/2011 22

IP driver responsibilities Get operating parameters from device driver Maximum packet size (MTU) Functions to initialize HW headers Length of HW header Routing packets From one physical network to another Fragmenting packets Send operations from higher-layers Receiving data from device driver Dropping bad/expired data 9/30/2011 23

Device driver (e.g., ethernet) responsibilities Controls network interface card Comparable to character driver Processes interrupts from network interface Receive packets Send them to IP driver Get packets from IP driver Send them to hardware Ensure packet goes out without collision Follow the rules of Ethernet s CSMA/CD 9/30/2011 24

Device header (Ethernet II) device header IP header TCP/UDP header IP data data dest addr src addr frame type data CRC 6 bytes 6 bytes 2 46-1500 bytes 4 18 bytes + data 9/30/2011 25

20 bytes IP header device header IP header TCP/UDP header IP data data vers hlen svc type (TOS) total length fragment identification flags fragment offset TTL protocol header checksum source IP address destination IP address options and pad 9/30/2011 26

20 bytes Headers: TCP & UDP hdr len TCP header src port checksum seq number ack number dest port - flags window urgent ptr options and pad UDP header src port dest port seg length checksum 8 bytes 9/30/2011 27

Network device Network card examines packets on wire Compares destination addresses Before packet is sent, it must be enveloped (encapsulated) for the physical network device header IP header IP data data 9/30/2011 28

Device addressing We need to use a packet address that makes sense on the network we re using: IP addresses mean nothing to an ethernet NIC IP address ethernet address Address Resolution Protocol (ARP) Check local ARP cache Send broadcast message requesting ethernet address of machine with certain IP address Wait for response (with timeout) 9/30/2011 29

The End 9/30/2011 30