Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP -...

40
Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model

Transcript of Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP -...

Page 1: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Lecture 6

Networked Systems   Network Operating Systems

Introduction to SocketsHTTP – FTP – TCP - UDP

    Client-Server Model

Page 2: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

A Data Network

Page 3: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Internetworking

Page 4: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Intranets & Extranets

Page 5: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Virtual Private Network (VPN)

Page 6: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Extranet Security and Privacy

Firewall - Network hardware and/or software that captures data passing through it and determines whether to pass or drop the data. Firewalls are configurable, and filters can be applied to provide the appropriate security for the LAN.

Public key certificate - An electronic document that can verify and authorize an individual by public key cryptography. Public key cryptography uses two keys14 (one public key and one private key) to encrypt and then decrypt data to ensure that a message can be transported securely.

Authentication encryption (AE) - A system that is able to protect both the secrecy and the integrity of data communication.

Virtual private network (VPN) - A network that is created when one net- work connects to another by a secure tunnel.

Page 7: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

LANs, WANs, & MANs

Page 8: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Network Relationships and Topologies

Network relationships refer to the communication that takes place between two nodes over a network. Examples are peer-to-peer and client/server.

The manner in which nodes in a network connect to a communication line in order to exchange data is an example of a physical topology.

Another topology type is the logical topology, which defines the way data is passed from endpoint to endpoint throughout the network. The logical topology is not affected by the way the nodes are physically arranged.

Page 9: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Client/Server Network

Page 10: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Peer-to-Peer Network

Page 11: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Network Topology

Page 12: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Bus Topology

Page 13: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Mesh Topology

Page 14: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Star Network

Page 15: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Advantages & Disadvantages of a Star Network

Page 16: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Ring Topology

Page 17: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Advantages & Disadvantages of a Ring Network

Page 18: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Hierarchical (Tree) Topology

Page 19: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Data Communication Protocols

Page 20: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Protocols Continued

Page 21: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

History of the Internet

Page 22: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.
Page 23: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

All People Seem To Need Data ProcessingThe OSI Reference Model

Page 24: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

The Four Layer + 1 TCP/IP Model

Physical Layer

Page 25: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Encapsulation of Data through the TCP/IP Layers

Page 26: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Networking Diagnostic Utilities

Page 27: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Client-Side Blocking Socket

A socket is like a handle to a file, similar to a StreamReader /StreamWriter in System.IO.

You can use sockets programming to have two applications communicate with each other. The applications are typically on the different computers but they can be on same computer.

For the two applications to talk to each other on the same or different computers using sockets, one application is generally a server that keeps listening to the incoming requests and the other application acts as a client and makes the connection to the server application.

http://www.devarticles.com/c/a/C-Sharp/Socket-Programming-in-C-Part-I/

Page 28: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

User Datagram Protocol (UDP)

• Connectionless User Datagram Protocol (UDP)– Provides minimum overhead necessary for the transport layer– No guarantee that UDP datagrams will reach their destination in

their original order, or at all

Deitel & Associates, Inc.

Page 29: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

TCP/IP Protocol Stack

• TCP/IP protocol stack– Composed of four logical levels called layers

• Application layer– Highest level– Provides protocols for applications to communicate

• Transport layer– End-to-end communication– Relies on network layer to determine proper path from one end of

communication to the other

• Network layer– Moving data between computers

• Link layer– Provides an interface between the network layer and the underlying

physical medium of the connection

Deitel & Associates, Inc.

Page 30: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Hypertext Transfer Protocol (HTTP)

• The Hypertext Transfer Protocol (HTTP) – An application layer protocol that allows the transfer of a variety

of data formats– HTTP defines a request for a resource and a response– Remote host processes the request and replies with a response

Deitel & Associates, Inc.

Page 31: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

File Transfer Protocol (FTP)

• FTP – Application layer protocol that allows file-sharing between

remote hosts– Specifies connections between two pairs of ports

• One pair sends control information that governs the session

• The other sends actual data

– After a connection is established, the client specifies actions for the FTP server to perform by issuing various requests to server

– Server attempts to satisfy each request, then issues a response specifying the result

Deitel & Associates, Inc.

Page 32: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Transmission Control Protocol (TCP)

• TCP is a connection-oriented transmission protocol– Guarantees that segments sent from a sender will arrive at the

intended receiver undamaged and in correct sequence– Handles error control, congestion control, and retransmission– Allow protocols like HTTP and FTP to send information into

network as simply and reliably as writing to a file on the local computer

Deitel & Associates, Inc.

Page 33: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Internet Protocol (IP)

• Internet Protocol version 4 (IPv4) is the dominant protocol for directing information over a network– Destinations on the Internet are specified by IP address

• IP addresses are 32-bit numbers in IPv4

• One of more names can be mapped to an IP address through the Domain Name System (DNS)

Deitel & Associates, Inc.

Page 34: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Internet Protocol version 6 (IPv6)

• In the near future, there will be more addressable nodes on the Internet than available addresses using IPv4– To combat this problem, Internet Engineering Task Force (IETF)

introduced Internet Protocol version 6 (IPv6)• IPv6 specifies three types of addresses

– Unicast» Unicast address describes a particular host on the Internet

– Anycast» Anycast addresses are designed to be sent to the nearest host in

a group of hosts– Multicast

» Multicast addresses are designed to send packets to all hosts in a group

Deitel & Associates, Inc.

Page 35: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Ethernet

• Ethernet uses Carrier Sense Multiple Access with Collision Detection (CSMA/CD) protocol– 802.3-style CSMA/CD

• A transceiver tests a shared medium to determine if it is available before transmitting data

• Due to delays in medium, it is possible that multiple transceivers may decide that the medium is clear and begin transmitting simultaneously

• If transceivers detect a collision caused by simultaneous transmissions, they continue to transmit bytes for a specific period of time to ensure that all transceivers become aware of the collision

• Each transceiver, after learning of a collision, waits for a random interval before attempting to transmit again

Deitel & Associates, Inc.

Page 36: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Fiber Distributed Data Interface (FDDI)

• Operates over fiber-optic cable– Support more transfers at greater speeds over larger distance

• Built on two Token Rings– The second usually being reserved for backup

Deitel & Associates, Inc.

Page 37: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

IEEE 802.11 (Wireless)

• 802.11 employs a method similar to Ethernet:– Carrier Sense Multiple Access with Collision Avoidance

(CSMA/CA)– Require each sender broadcast a Request to Send (RTS) to

entire network– Upon receiving an RTS

• Receiver broadcasts a Clear to Send (CTS) message to the entire network if the medium is available

Deitel & Associates, Inc.

Page 38: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Client/Server Model

• In a two-tier system– User interface resides on client– Data resides on server– Application logic lies on one or both of these components

• Three-tier system– Offers a clearer separation of application logic from user interface and

data

• Ideally, logic resides in its own layer– Possibly on a separate machine– Independent of client and data– Increased flexibility and extensibility

• Trade-off in multitier system– Increased network latency and more areas where the network could

fail

Deitel & Associates, Inc.

Page 39: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Deitel & Associates, Inc.

Page 40: Lecture 6 Networked Systems Network Operating Systems Introduction to Sockets HTTP – FTP – TCP - UDP Client-Server Model.

Summary

Network Operating Systems (NOS)

Network Sockets

Blocking vs non-Blocking Sockets

Network Topology

Network Types

TCP/IP Protocol Stack (1) Application (2) Transport (3) Network (4) Link

Hypertext Transfer Protocol (HTTP)

File Transfer Protocol (FTP)

Transmission Control Protocol (TCP)

User Datagram Protocol (UDP)

Ethernet

Token Ring

Fiber Distributed Data Interface (FDDI)

IEE 802.11 (Wireless)

Client/Server Model