C19: User Datagram and Multicast

Similar documents
C18: Network Fundamentals and Reliable Sockets

C14a: Internetworks and The Internet

Interprocess Communication

Transport Layer. Chapter 3: Transport Layer

What is a Network? TCP / IP. The ISO OSI Model. Protocols. The TCP/IP Protocol Suite. The TCP/IP Protocol Suite. Computer network.

JAVA Network API. 2 - Connection-Oriented vs. Connectionless Communication

CSCD 330 Network Programming

CSC 4900 Computer Networks: Transport Layer

Chapter 3 Transport Layer

Distributed Programming in Java

Advanced Java Programming. Networking

IP Address Assignment

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061. Lecture 2. Internetworking IPv4, IPv6

Introduction to the Transport Layer

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

JAVA SOCKET PROGRAMMING

Objectives. Chapter 10. Upon completion you will be able to:

Chapter 3 Transport Layer

Joseph Faber Wonderful Talking Machine (1845)

SEN366 (SEN374) (Introduction to) Computer Networks

Chapter Motivation For Internetworking

TCP /IP Fundamentals Mr. Cantu

Input ports, switching fabric, output ports Switching via memory, bus, crossbar Queueing, head-of-line blocking

Network Programming. Introduction to Sockets. Dr. Thaier Hayajneh. Process Layer. Network Layer. Berkeley API

Communication Paradigms

CS 4390 Computer Networks. Transport Services and Protocols

Computer Networks. General Course Information. Addressing and Routing. Computer Networks 9/8/2009. Basic Building Blocks for Computer Networks

Network+ Guide to Networks 6 th Edition. Chapter 4 Introduction to TCP/IP Protocols

Development of reliable protocol Sliding window protocols. C = channel capacity in bps I = interrupt/service time + propagation delay

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

Network Protocols - Revision

Transport Layer Overview

ICS 351: Networking Protocols

Transport Layer (TCP/UDP)

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Introduction to Sockets 9/25/14

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

Chapter 9: UDP sockets & address conversion function

Unix Network Programming

Chapter 11. User Datagram Protocol (UDP)

Chapter 3: Transport Layer Part A

CS164 Final Exam Winter 2013

Different Layers Lecture 20

Assignment - 1 Chap. 1 Wired LAN s

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

Network+ Guide to Networks, Seventh Edition Chapter 2, Solutions

TCP/IP and the OSI Model

CMSC 332 Computer Networks Transport Layer

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control

IEMS 5780 / IERG 4080 Building and Deploying Scalable Machine Learning Services

CSCE 463/612 Networks and Distributed Processing Spring 2018

Java networking using sockets

Networks. an overview. dr. C. P. J. Koymans. Informatics Institute University of Amsterdam. February 4, 2008

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

IPv6 Addressing. There are three types of IPV6 Addresses. Unicast:Multicast:Anycast

Chapter 7. Local Area Network Communications Protocols

Communication in Distributed Systems: Sockets Programming. Operating Systems

PART X. Internetworking Part 1. (Concept, IP Addressing, IP Routing, IP Datagrams, Address Resolution)

Networking Fundamentals

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1

Guide to Networking Essentials, 6 th Edition. Chapter 5: Network Protocols

Java Socket Application. Distributed Systems IT332

Internet Protocol (IP)

Data Communications and Networks Spring Syllabus and Reading Assignments

Java Network Programming

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

IPv4 addressing, NAT. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.

IP - The Internet Protocol

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

Computer Networking: A Top Down Approach Featuring the. Computer Networks with Internet Technology, William

UNIX Sockets. Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E.

Significance of TCP/IP Model Divya Shree Assistant Professor (Resource Person), Department of computer science and engineering, UIET, MDU, Rohtak

Socket Programming. Sungkyunkwan University. Hyunseung Choo Copyright Networking Laboratory

CCNA Questions/Answers IPv6. Select the valid IPv6 address from given ones. (Choose two) A. FE63::0043::11:21 B :2:11.1 C.

CSC 401 Data and Computer Communications Networks

Java Networking (sockets)

OSI Data Link & Network Layer

Vorlesung Kommunikationsnetze

Outline. IP Address. IP Address. The Internet Protocol. o Hostname & IP Address. o The Address

Networking Revision. TCP/IP Protocol Stack & OSI reference model. Basic Protocols. TCP/IP Model ANTHONY KAO NETWORKING FINAL EXAM SPRING 2014 REVISION

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

( A ) 1. WAP is a (A) protocol (B) hardware (C) software (D) network architecture

Configure Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) Service Settings on a Switch

SC/CSE 3213 Winter Sebastian Magierowski York University CSE 3213, W13 L8: TCP/IP. Outline. Forwarding over network and data link layers

C14b: Classless Intradomain Routing

Applied Networks & Security

MODULE: NETWORKS MODULE CODE: CAN1102C. Duration: 2 Hours 15 Mins. Instructions to Candidates:

TCP/IP Protocol Suite

Internet and Intranet Protocols and Applications

IP Addresses McGraw-Hill The McGraw-Hill Companies, Inc., 2000

Computer Networks. Lecture 9 Network and transport layers, IP, TCP, UDP protocols

TCP/IP Networking. Training Details. About Training. About Training. What You'll Learn. Training Time : 9 Hours. Capacity : 12

OSI and TCP/IP Models

OBJECT ORIENTED PROGRAMMING

TSIN02 - Internetworking

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 7

TCP/IP Network Essentials

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

CS 356: Computer Network Architectures. Lecture 15: DHCP, NAT, and IPv6. [PD] chapter 3.2.7, 3.2.9, 4.1.3, 4.3.3

What is the difference between unicast and multicast? (P# 114)

Transcription:

CISC 3120 C19: User Datagram and Multicast Hui Chen Department of Computer & Information Science CUNY Brooklyn College 4/18/2018 CUNY Brooklyn College 1

Outline Recap Network fundamentals IPv4, IPv6 addresses TCP and UDP Unicast, broadcast, and multicast User datagram and datagram socket Datagram unicast, broadcast, and multicast Datagram packet and streams 4/18/2018 CUNY Brooklyn College 2

A Few IPv4 Address Types Address Type Binary Prefix IPv4 CIDR Notation Private Network 1100 0000 1010 1000 192.168.0.0/16 10101100 0001 172.16.0.0/12 1010 0000 10.0.0.0/8 Loopback 0111 1111 127.0.0.0/8 Link-local Unicast 1111 1110 10 169.254.0.0/16 Documentation (TEST-NET-1) 1100 0000 0000 0000 0000 0010 192.0.2.0/24 Documentation (TEST-NET-2) 1100 0110 0011 0011 0110 0100 198.51.100.0/24 Documentation (TEST-NET-3) 1100 1011 0000 0000 0111 0001 203.0.113.0/24 Multicast 1110 224.0.0.0/4 Global Unicast Everything else (with exceptions) 4/18/2018 CUNY Brooklyn College 3

A Few IPv6 Address Types Address Type Binary Prefix IPv6 Notation Unspecified 00 0 (128 bits) ::/128 Loopback 00 1 (128 bits) ::1/128 Multicast 1111 1111 FF00::/8 Link-local Unicast 1111 1110 10 FE80::/10 Private Network 1111 110 FC00::/7 Documentation 0010 0000 0000 0001 0000 1101 1011 1000 Global Unicast 2001:0DB8::/32 Everything else (with exceptions) 4/18/2018 CUNY Brooklyn College 4

Multiplexing and Demultiplexing Network layer functionality belongs to a host How do applications share the network? Transport layer: multiplexing and demultiplexing host A App 1 App 2 host B App 1 App 2 Transport Layer Network Layer (IP) Transport Layer Network Layer (IP) 4/18/2018 CUNY Brooklyn College 5

TCP and UDP Transport Control Protocol User Datagram protocol Communication protocol for processes (a process represents a running program) Multiplexing and demultiplexing over the network layer (the Internet protocol) 4/18/2018 CUNY Brooklyn College 6

UDP User Datagram Protocol Implement solely multiplexing and demultiplexing over the network layer (the Internet protocol) Transmit independent datagram one at a time Communication is not reliable (called best effort) No guarantee on the order of datagrams No guarantee on the delivery of datagrams 4/18/2018 CUNY Brooklyn College 7

TCP and UDP Port Numbers For multiplexing and demultiplexing, how do we differentiate multiple processes (running programs) on a host? UDP port numbers 16 bit integer Use them to differentiate different processes on a host TCP port numbers 16 bit integer Use them to differentiate different processes on a host 4/18/2018 CUNY Brooklyn College 8

List TCP/UDP Port Statistics Use netstat, available on many operating systems (Windows, OS X, Linux ) Windows Linux OS X Examples netstat -n -o -p TCP; netstat -f -o -p TCP; netstat -n -o -p UDP; and netstat -f -o -p TCP Examples netstat n p -a -t; netstat p -a -t; netstat n p -a -u; and netstat p -a -u Examples netstat -n a p tcp; netstat a p tcp; netstat -n a p udp; and netstat a p udp; 4/18/2018 CUNY Brooklyn College 9

Some Practical Considerations Is a port (TCP, UDP, or both) available to our own programs? 1 1023 are privileged Registered ports (with iana.org, sometimes called well-known or service ports) See /etc/services on Mac OS X, or, Linux or Unix See C:\Windows\system32\drivers\etc\services on Windows A process may be running and assigned (called bound to) one or more ports A port can only be assigned to a single process Does the host-based or network-based firewall get in your way (at home, at the college, or at the coffee shop )? A firewall is an application that filter out some IP packets/tcp segments/udp datagrams Commonly, an organization only allows traffics to a small number of registered ports (e.g., 80 for HTTP, 443 for HTTPS, 53 for DNS) 4/18/2018 CUNY Brooklyn College 10

Programming with TCP and UDP Java network applications typically use TCP or UDP to communicate Typically no need to concern with innerworkings of TCP or UDP Use java.net package or other network related packages TCP communications The Socket, ServerSocket, URL, and URLConnection classes UDP communications The DatagramPacket, DatagramSocket, and MulticastSocket classes Need to understand the concept of Socket Most lower-level networking APIs are modeled after the Berkeley Socket API 4/18/2018 CUNY Brooklyn College 11

Socket A data structure (or an object) representing a two-way communication link between two programs running on the network Two end points Local and remote end points Each is a combination of IP address and port number IP address: identify a host Port number: identify a process (running program) on the host 4/16/2018 CUNY Brooklyn College 12

Questions Recap of relevant concepts 4/18/2018 CUNY Brooklyn College 13

Use Datagram Datagram Independent, self-contained message Best effort, no connection establishment is required Unreliable: there is no guarantee on arrival, arrival time, and order of arrival Light weight (less resource) UDP in Java The DatagramPacket, DatagramSocket, and MulticastSocket classes Unicast, broadcast, and multicast Often use for broadcasting or multicasting 4/18/2018 CUNY Brooklyn College 14

UDP Unicast: Example Echo a receive message (UDP datagram): knock, knock. Who is there? Essential classes: DatagramSocket, DatagramPacket KnockKnock1st: receive first Create a DatagramSocket whose local end point is bound to an address and a port of the host Receive a packet Prepare and send a reply packet KnockKnock2nd: send first Create a DatagramSocket, let JVM/OS determine the local port number Prepare and send a packet, filled with destination address and port number Receive a packet 4/18/2018 CUNY Brooklyn College 15

Datagram Multicasting and Broadcasting One important use case of Datagram is to realize multicasting or Broadcasting Multicasting: one-to-many Broadcasting: one-to-all (a special case of multicast) Question What kind of applications may multicast (or broadcast) benefit? Why? 4/18/2018 CUNY Brooklyn College 16

UDP Broadcast: Example Generate a list of random integers, and broadcast to any receivers Essential classes: DatagramSocket, DatagramPacket Broadcast Sender (one sender) Create a DatagramSocket Make sure SO_BROADCAST is enabled Not all networks support broadcast Send packets to broadcast address at a remote port Broadcast receivers Receive packet at the designated port Matching the port number of the remote end point given at the sender Use ByteArrayOutputStream, ByteArrayInputStream, DataInputStream, DataOutputStream to process packets 4/18/2018 CUNY Brooklyn College 17

UDP Multicast: Example Generate a list of random integers, and multicast to a group of receivers Essential classes: DatagramSocket, MulticastSocket, DatagramPacket Multicast sender (one sender) Create either a DatagramSocket or a MulticastSocket Send packet to the two addresses representing two multicast groups Multicast receivers (a group of receivers) Must create a MulticastSocket Join one of the two multicast groups indicated by their respective mutilcast address Receive packet Leave the group when done Use ByteArrayOutputStream, ByteArrayInputStream, DataInputStream, DataOutputStream to process packets 4/18/2018 CUNY Brooklyn College 18

IPv4 and IPv6 Java made it transparent to use IPv4 or IPv6. The code is essentially identical The difference is to use an IPv4 or an IPv6 address, respectively 4/18/2018 CUNY Brooklyn College 19

Questions User Datagram Protocol (UDP) UDP sockets in Java Connection-oriented (TCP) and connectionless (UDP) Unicast, broadcast, and multicast Use IPv4 or IPv6 4/18/2018 CUNY Brooklyn College 20

Assignments Practice assignments Project 4 4/18/2018 CUNY Brooklyn College 21