Ethernet. broadband or baseband signalling Hub and repeaters Ethernet switches and bridges: Ethernet packets Ethernet topologies

Similar documents
Network Programming with Sockets. Process Management in UNIX

Network Programming TDC 561

Objectives of Lecture. Network Architecture. Protocols. Contents

Ethernet. Ethernet. Network Devices

Transport Layer Protocols

Limi Kalita / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 5 (3), 2014, Socket Programming

SSC - Communication and Networking Java Socket Programming (II)

Operating Systems Design 16. Networking: Sockets

Socket Programming. Srinidhi Varadarajan

Transport layer protocols. Message destination: Socket +Port. Asynchronous vs. Synchronous. Operations of Request-Reply. Sockets

Tutorial on Socket Programming

Network Communication

Chapter 2: Remote Procedure Call (RPC)

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

Communication. Layered Protocols. Topics to be covered. PART 1 Layered Protocols Remote Procedure Call (RPC) Remote Method Invocation (RMI)

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

Internet Control Protocols Reading: Chapter 3

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

IP - The Internet Protocol

COMMMUNICATING COOPERATING PROCESSES

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

Protocols and Architecture. Protocol Architecture.

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

CPS221 Lecture: Layered Network Architecture

Network Programming using sockets

ELEN 602: Computer Communications and Networking. Socket Programming Basics

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

Middleware Lou Somers

Interprocess Communication Message Passing

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

Agenda. Distributed System Structures. Why Distributed Systems? Motivation

Ethernet. Ethernet Frame Structure. Ethernet Frame Structure (more) Ethernet: uses CSMA/CD

ERP Formatting Tutorial

Mathatma Gandhi University

Java Network. Slides prepared by : Farzana Rahman

How To Write A Network Operating System For A Network (Networking) System (Netware)

ICOM : Computer Networks Chapter 6: The Transport Layer. By Dr Yi Qian Department of Electronic and Computer Engineering Fall 2006 UPRM

Session NM059. TCP/IP Programming on VMS. Geoff Bryant Process Software

The exam has 110 possible points, 10 of which are extra credit. There is a Word Bank on Page 8. Pages 7-8 can be removed from the exam.

transmission media and network topologies client/server architecture layers, protocols, and sockets

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

Lecture 28: Internet Protocols

NETWORKING FEATURES OF THE JAVA PROGRAMMING LANGUAGE

Transport Layer. Chapter 3.4. Think about

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

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

UNIX Sockets. COS 461 Precept 1

Introduction to Computer Networks

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

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

Learning Outcomes. Networking. Sockets. TCP/IP Networks. Hostnames and DNS TCP/IP

Socket Programming in C/C++

Written examination in Computer Networks

Socket = an interface connection between two (dissimilar) pipes. OS provides this API to connect applications to networks. home.comcast.

Architecture and Performance of the Internet

Computer Networks Network architecture

[Prof. Rupesh G Vaishnav] Page 1

Answer FIVE Questions only. Each carries 20 marks.

Overview of Computer Networks

TCP/IP - Socket Programming

Network Layer: Network Layer and IP Protocol

Chapter 11. User Datagram Protocol (UDP)

Socket Programming. Announcement. Lectures moved to

Exam 1 Review Questions

Chapter 3. Internet Applications and Network Programming

Data Communication Networks and Converged Networks

CCNA R&S: Introduction to Networks. Chapter 5: Ethernet

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

2. What is the maximum value of each octet in an IP address? A. 128 B. 255 C. 256 D. None of the above

Data Communication & Networks G

Chapter 7: Computer Networks, the Internet, and the World Wide Web. Invitation to Computer Science, C++ Version, Third Edition

CSE331: Introduction to Networks and Security. Lecture 6 Fall 2006

Question: 3 When using Application Intelligence, Server Time may be defined as.

Computer Networks UDP and TCP

WAN Data Link Protocols

Internet Concepts. What is a Network?

PART OF THE PICTURE: The TCP/IP Communications Architecture

BSD Sockets Interface Programmer s Guide

File Transfer And Access (FTP, TFTP, NFS) Chapter 25 By: Sang Oh Spencer Kam Atsuya Takagi

Overview of TCP/IP. TCP/IP and Internet

Introduction to Socket programming using C

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

q Connection establishment (if connection-oriented) q Data transfer q Connection release (if conn-oriented) q Addressing the transport user

Communication Systems Internetworking (Bridges & Co)

Networking Test 4 Study Guide

Writing Client/Server Programs in C Using Sockets (A Tutorial) Part I. Session Greg Granger grgran@sas. sas.com. SAS/C & C++ Support

Transport and Network Layer

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

Introduction to computer networks and Cloud Computing

RARP: Reverse Address Resolution Protocol

Data Link Protocols. TCP/IP Suite and OSI Reference Model

Division of Informatics, University of Edinburgh

Fundamentals of Symbian OS. Sockets. Copyright Symbian Software Ltd.

COMP5426 Parallel and Distributed Computing. Distributed Systems: Client/Server and Clusters

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

Data Communication and Computer Network

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

ESSENTIALS. Understanding Ethernet Switches and Routers. April 2011 VOLUME 3 ISSUE 1 A TECHNICAL SUPPLEMENT TO CONTROL NETWORK

Computer Network. Interconnected collection of autonomous computers that are able to exchange information

Transcription:

Ethernet broadband or baseband signalling Hub and repeaters Ethernet switches and bridges: Ethernet packets Ethernet topologies Bus, star, tree. Carrier-Sense Multiple Access with Collision Detection (CSMA/CD) All nodes are continuously listening to the medium for packets that are addressed to them. Packets frames Prefix: hardware timing purposes the destination address, the sending address; length of data (46,500 bytes), data of variable length, checksum

Ethernet Packet collision carrier sensing: not enough time = 0 A B time = T A B Message almost there at time T when B starts collision! Collision detection Sender s responsibility to detect A B time = 2T Minimum packet length in collision detection Send jamming signal, delay and try again Delay time is selected using binary exponential back-off 2 2

Middleware Applications, services RMI and RPC This chapter request-reply protocol marshalling and external data representation Middleware layers UDP and TCP Application programming interfaces (APIs) Examples of middleware services Remote data access (RDA) -- SQL access to server-based DBMS. Remote procedure calls (RPC) Remote method invocation (RMI) Today s topics Interprocess communication (IPC); Java API for Internet transport protocols External data representation and marshalling 3 3

InterProcess Communication two basic models shared memory message passing two basic operations on messages Send (to, message) Receive (from, message) A typical communication system 4 4

Types of communication Persistent communication Stores message until communicated to user Transient communication Stored only when sending and receiving processes are alive Transport level protocols provide transient communication Asynchronous Sender continues after sending message Synchronous Sender blocks until message is stored at receiver's local buffer, delivered to receiver or processed by receiver Example of Persistent Asyn. Comm.: email system 5 5

c) Transient asynchronous communication: UDP, oneway RPCs. d) Receipt-based transient synchronous communication e) Delivery-based transient synchronous communication at message delivery: Asyn. RPCs f) Response-based transient synchronous communication: PRCs, RMIs. 6 6

IPC mechanisms Pipes processes must be related through a common ancestor impossible in a distributed environment shared memory Sockets 4.4BSD Unix Java message queues: Message-oriented Middleware (MOM) socket any port agreed port socket message client server other ports Internet address = 38.37.94.248 Internet address = 38.37.88.249 7 7

Socket Types in 4.4BSD UNIX Stream socket: provides for the bidirectional, reliable, sequenced, and unduplicated flow of data without record boundary. Very similar to pipe Datagram socket: supports bidirectional flow of data which is not promised to be sequenced, reliable, or unduplicated Reliability guaranteed by high-level apps. Most widely used in name service, time service. A raw socket: provides users access to the underlying communication protocols which support socket abstractions. Not for general users Sequenced packet socket: No protocol for this typ 8 8

Socket creation: socket() communication domains local domain: at the same machine internet domain: Internet XNS domain: XEROX Network Systems s = socket(domain, type, protocol); A system call domain: AF_UNIX, AF_INET, or AF_NS type: SOCK_STREAM, SOCK_DGRAM, etc protocol: TCP or UDP. Auto selected if 0 Return a socket descriptor (a small integer for later reference) Ex: s = socket(af_inet, SOCK_STREAM, 0); Creation Failure: Reasons Lack of memory (ENOBUFS) Unknown protocol (EPROTONOSUPPORT) Socket without supporting protocol (EPROTOTYPE) 9 9

Binding Names: bind() Socket created without a name (i.e. port address) Process has no way to access it. System call: bind(s, address, len) s: socket descriptor address: <local address, local port> or a path name len: the length of the address. Connection Establishment Asymmetric, involving a server and a client Server: create bind listen accept Client: create bind connect connect(s, address, len) s: socket descriptor address: server address len: the length of the address 0 0

Connection Failure Timeout (ETIMEDOUT) Server down or network corrupt Connection refused (ECONNREFUSED) Server not ready yet Network down or server down operational errors are returned by the underlying communication system Unknown host operational errors returned by intermediate gateways or switching nodes. System Call: listen() listen(s, max_num) s: socket descriptor max_num: the maximum number of outstanding connections which may be queued awaiting acceptance by the server process If the queue is full, a connection will be ignored (instead of refused). Why?

System call: accept() newsock = accept(s, from-addr, len) s: socket descriptor from-addr: to store the address of the client Usually a pointer, could be null len: length of from-addr Return a new socket. Usually block the caller Cannot select the client to be accepted. Data Transfer Once a connection is established, data flow may begin. write(s, buf, sizeof (buf)); send(s, buf, sizeof (buf), flags); read(s, buf, sizeof (buf)); recv(s, buf, sizeof (buf), flags); Flags: provide more features 2 2

Discarding Sockets close(s) Sockets which promises reliable transmission will still attempt transfer data. Shutdown(s, how), where how is 0: no more receiving : no more sending 2: no more receiving or sending server socket() client socket() bind() listen() connect() write() read() read() write() Start a thread accept() accept() Wait for new connection close() close() 3 3

Java Sockets server client socket() socket() accept() writeutf() readutf() readutf() writeutf() Start a thread accept() Wait for new connection close() close() 4 4

Java API for the Internet protocols Transport address: IP address + port number java.net.inetaddress Static InetAddress.getByName(String host) host name: java.sun.com gethostaddress(): IP address string in textual presentation. gethostname(): the host name for this IP address. 32-bit integers for port number Socket types UDP socket TCP socket 5 5

UDP socket Data unit: datagram Called datagram socket Socket must be bound to a local port and one IP address Server: well-known port Client: any free one issues related to datagram communication Message size non-blocking send operations and blocking receive operations Timeouts applications use UDP: Domain Naming Service, Voice Over IP 6 6

UDP socket Encapsulated in Class DatagramSocket Datagram: Class DatagramPacket DatagramSocket.send(DatagramPacket) DatagramSocket.receive(DatagramPacket) DatagramSocket.setSoTimeout(int timeout) DatagramSocket.connect(InetAddress, int port ) public DatagramPacket(byte[] buf, int length, InetAddress address, int port) 7 7

TCP socket TCP is a connection-oriented protocol, a connection is established first. Server listens connection request Client asks for a connection Two types of TCP sockets: ordinary sockets and server sockets A client process constructs an ordinary socket and then it asks for a connection with the server. A server socket receives a connection request, it constructs an ordinary socket with an unused port number which completes the connection. No limit on data size. Streams: one in each direction 8 8

Some issues in stream communication Matching of data items Blocking Threads Applications use TCP: HTTP, FTP, Telnet, SMTP. ordinary TCP socket: Socket server socket: ServerSocket ServerSocket(int port), or ServerSocket.bind(SocketAddress, int port); Socket ServerSocket.accept(); InputStream and OutputStream classes An example in textbook 9 9

Message-oriented Middleware (MOM) Main features intermediate-term storage for messages: persistent! neither sender nor receiver is required to be active Message queue eliminate the need for programs to be logically connected: asynchronous! takes minutes Only guarantee is that a message will be inserted in receivers queue. But no guarantees about when, or even if the message will actually be read Source queue & destination queue Queue managers: Message Queue Interface (MQI) Overlay network 2 0 20

Message Brokers Issue: message format How to make sure the receiver understands sender s message? One format? Application are too diverse. Act as an application level gateway E.g. change delimiters at the end of records Application A outputs: Account Id, Trader Id, Price, Quantity, Date, Customer Id Application inputs: Date, Customer Id, Account Id, Price, Quantity, Trader Id Parse Rules Transform Application 2 inputs: Date, Price, Quantity, Trader Id Application B outputs: Customer Id, Account Id, Trader Id, Price, Quantity, Date Application 3 inputs: Date, Customer Id, Price, Quantity 2 2

Example: IBM MQSeries Queues Local Queue Remote Queue Alias Queue Model Queue Some properties of local queues: Maximum Message Size Maximum Queue Depth Enable/Disable Put or Get Persistent/Not Persistent Local queues can generate events (messages) under certain conditions (like queue full). Queue managers Channels Message Channels: message channel agent (MCA) MQI channels: client channels 2 2 22

Example: IBM MQSeries Messages descriptor + application data Four types of messages: request message reply message. one-way message report message: generated by the Queue Manager. For example, Delivery confirmation. Messages can have a time-to-live, called Expiry: Each queue manager can have a dead-letter queue. persistent or non-persistent messages Message Priority & Message Correlator Segmented Messages - allows ending of VERY LARGE messages (> 00 MB) A reply to address (the name of a Queue Manager and Queue). Messages are added and removed from queues in Units of Work 2 3 23

External data representation and marshalling Heterogeneity: different representations for simple data items. Big Endian vs. Little Endian Solutions transmitted in the sender s format together with an indication of the format used converted to an agreed external format An agreed standard for the representation: external data representation Marshaling vs. Unmarshalling CORBA s Common Data Representation (CDR); Java s object serialization; XML (Extensible Markup Language) 2 4 24

Java object serialization Goal: supports the encoding of objects, and the objects reachable from them, into a stream of bytes and the complementary reconstruction of the object graph from the stream. the state of an object sufficient information to reconstruct the object the receiving process has no knowledge about the types of objects Reference: handles Objects to be serialized in the stream may support either the Serializable or the Externalizable interface. the java.io.serializable interface 2 5 25

Java object serialization Serializable objects implement the java.io.serializable interface You can implement one or more of the methods readobject(), writeobject() to custom serialization. Externalizable objects implement the java.io.externalizable interface the programmer takes full responsibility for the serialization and deserialization of objects. java.io.objectoutputstream and java.io.objectinputstream Serialization will preserve the state of all fields in the object graph except for fields marked transient or static or fields contained in superclasses that are not serializable. 2 6 26

Java object serialization Visibility modifiers (e.g., private, protected, etc.) on fields do not affect serialization. Any subclasses of a serializable class are serializable classes, and any data inside a serializable class are also serializable data. Two important methods: readobject(), reads an object from the defined input stream writeobject(), writes an object to an output stream. Other methods that support the serialization and deserialization of primitive data types: readint, readfloat, writeint, writefloat, etc. 2 7 27