CSCE 463/612 Networks and Distributed Processing Spring 2018

Similar documents
Announcements. CS 5565 Network Architecture and Protocols. Outline for today. The Internet: nuts and bolts view. The Internet: nuts and bolts view

Internet Architecture & Performance. What s the Internet: nuts and bolts view

Web Protocols and Practice

CS 332: Computer Networks Introduction

Network Protocols and Architectures

Chapter 1: Introduction

CSEN 503 Introduction to Communication Networks

Internet Routing. Review of Networking Principles. What s the Internet: nuts and bolts view. Communication links

Internet Routing. Review of Networking Principles

Part 1: Introduction. Goal: Review of how the Internet works Overview

CSE3213 Computer Network I

Part I: Introduction. 1: Introduction 1

RSC Part I: Introduction

COMP 562: Advanced Topics in Networking

Announcements. TAs office hours: Mohamed Grissa: Mohamed Alkalbani:

Welcome to CS 340 Introduction to Computer Networking

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

Chapter 1. Computer Networks and the Internet

CNT 4007 Computer Networks - Chapter 1 : Overview

CS 471G Friday, 11 January Introduction 2-1

Lecture 2: Internet Structure

CSCE 463/612 Networks and Distributed Processing Spring 2018

A Whirlwind Introduction to the Internet. A Whirlwind Introduction to the Internet Overview

What s a protocol? What s a protocol? A closer look at network structure: What s the Internet? What s the Internet? What s the Internet?

ECPE / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Chapter 1 Computer Networks and the Internet

CS 204: Advanced Computer Networks

What s a protocol? What s a protocol? A closer look at network structure: What s the Internet? Hardware view: What s the Internet?

end systems, access networks, links 1.3 network core

Networks Overview. Dr. Yingwu Zhu

CSCE 463/612 Networks and Distributed Processing Spring 2018

CSC 4900 Computer Networks: Introduction

Chapter 1 Introduction

Since enrollment is very small this semester, we have flexibilty. Traditional lecture Assigned reading, and then student(s) present during class time

CS 3516: Advanced Computer Networks

Lecture 2 Communication services The Trasport Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Switching Networks (Fall 2010) EE 586 Communication and. August 27, Lecture 2. (modified by Cheung for EE586; based on K&R original) 1-1

CS 3516: Computer Networks

Computer Networks and the Internet. CMPS 4750/6750: Computer Networks

end systems, access networks, links circuit switching, packet switching, network structure

COMP 431 Internet Services & Protocols. A Whirlwind Introduction to the Internet ( Networking Nouns and Verbs ) Jasleen Kaur

Introduction to computer networking

CS 4390 Computer Networks. Transport Services and Protocols

Course on Computer Communication and Networks. Lecture 1 Chapter 1: Introduction Part A: Internet, Protocol Layering and Data

What is a Distributed System? Module 1: Introduction to Networking & Internetworking

Network and Mobile Compu4ng in the 20 th Century and Beyond. COMP 1400 Memorial University Winter 2015

ECE 650 Systems Programming & Engineering. Spring 2018

CSCD 330 Network Programming

JAMES F. KUROSE AND KEITH W. ROSS

Foundations of Telematics

Outline. Inter-Process Communication. IPC across machines: Problems. CSCI 4061 Introduction to Operating Systems

Overview on the Internet the current and future telecommunication network

Chapter 1: introduction

ECE 650 Systems Programming & Engineering. Spring 2018

Introduction to Computer Networks. Roadmap

Computer Networks 2012/2013. Introduction part 1 (01) Dr. Tanir Ozcelebi. Thanks to A. Leon-Garcia & I. Widjaja, & I. Radovanovic & A. S.

Suprakash Datta. Office: LAS 3043 Phone: ext Course page:

A Whirlwind Introduction to the Internet. A Whirlwind Introduction to the Internet Overview

CSCE 463/612 Networks and Distributed Processing Spring 2018

Networking and Internetworking 1

CSCE 463/612 Networks and Distributed Processing Spring 2017

A closer look at network structure:

Chapter 2 Application Layer. Lecture 4: principles of network applications. Computer Networking: A Top Down Approach

Course Introduction. Off script lecturing on whiteboard Just as important towards exams, etc.

Chapter 7 Transport Layer. 7.0 Introduction 7.1 Transport Layer Protocols 7.2 TCP and UDP 7.3 Summary

CSE 4213: Computer Networks II

Defining the Internet

Lecture 9: Transpor Layer Overview and UDP

Computer Networking Introduction

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

CS 3516: Advanced Computer Networks

Transport Layer. Chapter 3: Transport Layer

CSCE 463/612 Networks and Distributed Processing Spring 2018

CSEN 503 Introduction to Communication Networks. Mervat AbuElkheir Hana Medhat Ayman Dayf. ** Slides are attributed to J. F.

Protocol Layers, Security Sec: Application Layer: Sec 2.1 Prof Lina Battestilli Fall 2017

OSI Transport Layer. objectives

Fundamentals of Information Systems

CMSC 322 Computer Networks Applications and End-To- End

CSC 401 Data and Computer Communications Networks

ENEE 457: Computer Systems Security 11/07/16. Lecture 18 Computer Networking Basics

CSCD 330 Network Programming

Different Layers Lecture 21

CSCE 463/612 Networks and Distributed Processing Spring 2017

Review. Error Detection: CRC Multiple access protocols. LAN addresses and ARP Ethernet. Slotted ALOHA CSMA/CD

NT1210 Introduction to Networking. Unit 10

CS 326: Operating Systems. Networking. Lecture 17

CSC 401 Data and Computer Communications Networks

Transport Layer Overview

Introduction and Layered Network Architecture. EEE 538 Dr. Nail Akar Bilkent University Electrical and Electronics Engineering Department

Computer Networks. Lecture 1: Introduction. Computer Networking: A Top Down Approach. Dr. Yaoqing Liu

Ten most important ideas/concepts to take away from Chapter 1

CSCE 463/612 Networks and Distributed Processing Spring 2018

Page 1. Review: Internet Protocol Stack. Transport Layer Services EEC173B/ECS152C. Review: TCP. Transport Layer: Connectionless Service

Computer Communication Networks

CSC358 Week 2. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

EECS 228a Lecture 1 Overview: Networks. Jean Walrand

Goal and A sample Network App

Introduction to Data Communication

Data Communications and Networks Spring Syllabus and Reading Assignments

Transcription:

CSCE 463/612 Networks and Distributed Processing Spring 2018 Introduction Dmitri Loguinov Texas A&M University January 23, 2018 Original slides copyright 1996-2004 J.F Kurose and K.W. Ross 1

Updates Recv loop reminder timeout.tv_usec must be initialized to zero NULL-terminate buf before searching with strchr or strstr while (true) { FD_SET (...); if ((ret = select (0, &fd,..., &timeout)) > 0) { // new data available; now read the next segment int bytes = recv (sock, buf + curpos, allocatedsize curpos,...); if (errors) // print WSAGetLastError() & return false; if (connection closed) { buf[curpos] = NULL; return true; // normal completion } curpos += bytes; // adjust where the next recv goes if (allocatedsize curpos < THRESHOLD) // realloc() buf to double its size } else if (timeout) // report timeout & return false; else // print WSAGetLastError() & return false; } commonly forgotten 2

Chapter 1: Roadmap 1.1 What is the Internet? 1.2 Network edge 1.3 Network core 1.4 Network access and physical media 1.5 Internet structure and ISPs 1.6 Delay & loss in packet-switched networks 1.7 Protocol layers, service models 1.8 History 3

The Internet: Nuts and Bolts View 1) Hosts (end systems) Computing devices (servers, desktops, phones, laptops) Run network apps 2) Routers Forward packets (chunks of data) to destinations 3) Communication links Connect hosts & routers Fiber, copper, radio, satellite Transmission rate = bandwidth router server workstation mobile 4

The Internet: Nuts and Bolts View 4) Protocols Control sending/receiving of messages (e.g., TCP, IP, HTTP, FTP, SMTP) Internet: network of networks Loosely hierarchical Who rules the Internet? No single authority, mostly decentralized Internet standards IETF: Internet Engineering Task Force RFC: Request for comments router local ISP server workstation regional ISP mobile company network 5

What s s a Protocol? Human protocols: What s the time? I have a question Introductions specific msgs sent specific actions taken when msgs received or other events take place Network protocols: Machines rather than humans All communication activity in the Internet governed by protocols Protocols define format, order of messages sent and received among network entities, and actions taken on message transmission/receipt 6

What s s a Protocol? A human protocol and a computer network protocol: Hi Hi TCP connection accept TCP connection request 2:00 Got the time? Thanks <file> GET index.html connection close You re welcome time OK 7

Closer Look at Network Structure Network edge: Applications and hosts Network core: Routers Links How large is the edge? Billions of hosts, trillions of web pages, zettabytes of information Large ISPs form the Internet backbone Terabits per second router speed 8

Chapter 1: Roadmap 1.1 What is the Internet? 1.2 Network edge 1.3 Network core 1.4 Network access and physical media 1.5 Internet structure and ISPs 1.6 Delay & loss in packet-switched networks 1.7 Protocol layers, service models 1.8 History 9

Network Edge The edge: Responsible for almost all data supply/demand Protocols impact performance Client/server model Client host requests, receives service from always-on server Example: web browser/server; email client/server Peer-to-peer (P2P) model: Minimal use of dedicated servers; user hosts talk to each other Example: Skype, BitTorrent 10

Network Edge: Reliable Service Goal: data transfer between sockets TCP Transmission Control Protocol Internet s reliable service Connection-oriented Handshaking: send connection messages (prepare) for data transfer ahead of time Set up state in two communicating hosts TCP service [RFC 793] Reliable, in-order bytestream data transfer Packet loss handled through acknowledgements and retransmissions Flow control: Sender won t overwhelm receiver Congestion control: Senders reduce transmission rate when network becomes congested 11

Network Edge: Unreliable Service Goal: data transfer between sockets Same as before! UDP User Datagram Protocol [RFC 768]: Connectionless Unreliable data transfer No flow control No congestion control Less overhead and delay TCP connection setup & termination is 7 packets TCP retransmission delay is potentially unbounded Apps using TCP: HTTP (Web), FTP (file transfer), SSH (remote login), SMTP (email) Apps using UDP: DNS, SNMP Short (single-packet) transfers No need for congestion management Streaming media, online games, IP telephony More sensitive to delay than packet loss 12

Chapter 1: Roadmap 1.1 What is the Internet? 1.2 Network edge 1.3 Network core 1.4 Network access and physical media 1.5 Internet structure and ISPs 1.6 Delay & loss in packet-switched networks 1.7 Protocol layers, service models 1.8 History 13

The Network Core Supports end-host communication Fundamental question: how is data transferred through the network? Circuit switching: dedicated circuit per call (telephone network, origin 1800s) Packet-switching: data sent in discrete chunks (1960s) Notation Call = connection = flow 14

Network Core: Packet Switching End-end data stream divided into packets Packets of users A and B share network resources Each packet uses full link bandwidth Resource contention: Aggregate resource demand can exceed amount available Congestion: packets queue, wait for link use Store-and-forward: Packets move one hop (router) at a time Node receives complete packet before forwarding 15

Packet Switching: Statistical Multiplexing A 10 Mbps Ethernet statistical multiplexing C B queue of packets waiting for output link 1.5 Mbps D E Sequence of A s and B s packets does not have a fixed pattern statistical multiplexing 16

Packet Switching vs. Circuit Switching Packet switching allows more users than circuit switching 1 Mbps link Each user: 100 Kbps when active N users Active 10% of time Circuit-switching: Supports 10 users Packet switching: With 35 users, probability that more than 10 are active is 0.0424%; with 50 users 0.94% Max 100 users (if perfectly unsynchronized) 1 Mbps link 17

Packet Switching: Store-and-Forward L R R R Takes L/R seconds to transmit (push out) packet of L bits on to link of R bps Entire packet must arrive at router before it can be transmitted on next link: store and forward Path delay = 3L/R Example: L = 7.5 Mbits R = 1.5 Mbps End-to-end delay = 15 sec 18

Multi-Threading Threads execute concurrently as part of a process Benefits: Allows for parallelism in a multiprocessor/multicore system If a blocking call is made in one thread, other threads can continue executing Issues: Memory is shared between threads, concurrent access requires proper synchronization Order of execution of threads is non-deterministic Homework note: pass shared parameters to threads using a dedicated class instead of using global variables (see 463-sample.zip on course site) 19

Multi-Threading 2 Reasons for using multiple threads in hw #1 Web servers respond slowly (1-10 seconds/request) While a thread is suspended waiting for connect() and recv(), other threads should be allowed to work Multiple threads achieve significant speed-up You could run thousands of threads, but limit your testing to 10 until you know it works correctly Common synchronization mechanisms Mutex (mutual exclusion): allows only one thread access to critical section; others must wait Semaphore: allows up to N concurrent threads Event: binary (i.e., ON or OFF) signal 20

Multi-Threading 3 Mutex usage Any data structure (e.g., queue) or resource (e.g., screen or disk) modified by parallel threads needs to be protected If not, inconsistencies (data corruption) may result CRITICIAL_SECTION cs; InitializeCriticalSection (&cs); EnterCriticalSection (&cs); // critical section here... LeaveCriticalSection (&cs); // lock Events CreateEvent, WaitForSingleObject, CloseHandle See MSDN for additional details 21

Multi-Threading 4 A semaphore has a numerical value s attached to it Wait on semaphore (operation P) If s == 0, the semaphore suspends the calling thread If s > 0, the thread is allowed access and s is set to s-1 Release semaphore (operation V) If threads are waiting, unblock one of them and run it Otherwise, increment s = s + 1 HANDLE sema = CreateSemaphore (...); DWORD ret = WaitForSingleObject(sema, INFINITE); if (ret!= WAIT_OBJECT_0) // report error // wait // critical section... if (ReleaseSemaphore (sema,...) == FALSE) // report error // release 22