• No results found

Network Programming TDC 561

N/A
N/A
Protected

Academic year: 2021

Share "Network Programming TDC 561"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

1

Network Programming TDC 561

Lecture # 1

Dr. Ehab S. Al-Shaer

School of Computer Science & Telecommunication DePaul University

Chicago, IL

Dr. Ehab Al-Shaer/Network Programming

2

Network Programming

Goals of this Course:

Studying, evaluating and developing alternative client-server network architectures

Perquisites

Text Books

Assignments and the course Project

Rules and Policies

What do you expect?

Applications of this course

3

Applications of Network Programming

Network Tools

• traditional: telnet, ftp, rsh, rlogin, SMTP,

Internet Tools

• gopher, HTTP, NTP, Chat rooms

Collaborative Tools

• Application Sharing , Desktop Conferencing, Distance Learning

Distributed Object Computing

• SUN RPC, CORBA, JAVA RMI

Distributed Databases

(2)

Dr. Ehab Al-Shaer/Network Programming

4

IRI: Interactive Distance Learning

Dr. Ehab Al-Shaer/Network Programming

5

MASH: Internet-based Video Conferencing

6

Network Overview OSI Seven Layer Model

Layering (service abstraction)

• Problem decomposition

• Modular design

• Interoperability

OSI Principles:

• Different level of abstraction

• Well-defined functions

• Supporting open system

• Well-defined interfaces (layers boundaries)

• Different functions are in different layers

(3)

Dr. Ehab Al-Shaer/Network Programming

7

Network Overview OSI Seven Layer Model

OSI Seven Layers

- Physical Layer - Transport Layer - Data Link Layer - Session Layer - Network Layer - Presentation Layer

- Application Layer

Internet (TCP/IP) Model

- Application Layer (telnet, ftp) - Transport Layer (TCP) - Network Layer (IP)

- Host-to-Network: device drivers of various MAC protocols (Ethernet, token-ring)

Dr. Ehab Al-Shaer/Network Programming

8

TCP/IP Overview

(Transmission Control Protocol/Internet Protocol)

Internet Protocol (IPv4 and IPv6)

• IP is the network layer: a packet delivery service (host-to-host).

• Connectionless: each datagram is independent of all others.

• Unreliable: there is no guaranteed delivery

• Fragmentation / Reassembly (based on MTU).

• Routing.

• Error detection (link).

9

IP Address Formats

0 NetID

10

110 NetID

1110 Multicast Address HostID

NetID HostID

HostID

Class

A B C D

8 bits 8 bits 8 bits

8 bits

(4)

Dr. Ehab Al-Shaer/Network Programming

10

TCP/IP Overview (cont.)

IP Addresses

• 32 bit, Logical, unique

• eg. condor.cs.depaul.edu is 140.192.1.6

IP Packet Format:

VERS HL

Fragment Offset Fragment Length TOS

Datagram ID FLAG

TTL Protocol Header Checksum Source Address

Destination Address Options (if any)

Data

Dr. Ehab Al-Shaer/Network Programming

11

ARP

(Address Resolution Protocols)

HEY - Everyone please listen! Will 128.213.1.5 please send me his/her Ethernet address

not me

Hi Red! I’m 128.213.1.5, and my Ethernet address is 87:A2:15:35:02:C3

12

RARP

(Reverse Address Resolution Protocols)

HEY - Everyone please listen!

My Ethernet address is22:BC:66:17:01:75.

Does anyone know my IP address ?

not me Hi Red ! Your IP address is 128.213.1.17.

(5)

Dr. Ehab Al-Shaer/Network Programming

13

Transport Layer of TCP/IP

IP is the network protocols, means TCP is the transport protocol, right?

• Not exactly, TCP is part of the transport protocol, and the other part is UDP (User Datagram Protocol).

Ports

• Abstract destination point

• 16 bit positive integer for UDP and TCP

• Reserved/ Well-known ports: 1-1023

• Registered ports: 1024-49151

• Dynamic ports: 49151-65535

Dr. Ehab Al-Shaer/Network Programming

14

TCP UDP

IP

Hardware

Process Layer

Transport Layer

Network Layer

Data-Link Layer

Process Process

15

Transport Layer of TCP/IP

TCP supports:

• Connection-oriented (establish, terminate, notify)

• Reliable (ordered, no loose, and no duplicates)

• Buffering (configurable, though)

• Byte stream

• Full-duplex

UDP supports:

• Connectionless

• Unreliable

• Message stream (Datagram)

• Full-duplex

(6)

Dr. Ehab Al-Shaer/Network Programming

16

TCP Segment Format

Destination Port

Options (if any)

Data Source Port

Sequence Number Request Number

offset Reser. Control Window

Checksum Urgent Pointer

Dr. Ehab Al-Shaer/Network Programming

17

TCP/IP Overview

Source Port Destination Port

Length Checksum

Data

UDP Datagram Format

Hmmmmm, Which one to use: TCP or UDP?

18

Client-Server Architecture Design

Terminology

• A client initiates communication

• A server waits for incoming requests

• Integrated model (e.g. server as client)

• Does TCP/IP care?

Client-Server Paradigms

• Message passing (Synch and Asynch)

• Remote Procedure Call (Syncg and Asynch)

(7)

Dr. Ehab Al-Shaer/Network Programming

19

Client-Server Architecture Design (cont.)

Client-Server Communication Models

• Point-to-point Vs. Multi-point/Group – A client to multiple servers

– A server to multiple clients

• Broadcast Vs. Multicast

• Connection-oriented Vs. Connectionless

Dr. Ehab Al-Shaer/Network Programming

20

Client-Server Architecture Design (cont.)

Servers Design Issues

• System Ports Vs. User Ports

• Statefull Vs. Stateless Servers

• Privileges and Complexity: authentication, authorization, data sharing, privacy, protection

• Robustness and Reliability

• Client or Message Independent

• Client or Message Independent (dispatching)

• Concurrency

- Multi-processes - Multi-threaded - I/O Multiplexing - Asynchronous I/O

21

Client-Server Architecture Design (cont.)

Client Design Issues

• Server Independent (dispatching)

• Stateless Protocol/Messages (e.g. slide tool)

• Rich and Flexible Parameters (e.g. telnet )

(8)

Dr. Ehab Al-Shaer/Network Programming

22

Sockets Programming

Network API

Socket Structures

Socket Functions

Dr. Ehab Al-Shaer/Network Programming

23

Network Application Programming Interface (API)

The services provided by the operating system that provide the interface between application and protocol software.

Application Network API

Protocol A Protocol B Protocol C

24

Network API

Generic Programming Interface.

Support for message oriented and connection oriented communication.

Uses the existing I/O services

Operating System independence.

Support multiple communication protocol suites (families): IPv4, IPv6, XNS, UNIX.

Provide special services for Client and

Server?

(9)

Dr. Ehab Al-Shaer/Network Programming

25

TCP/IP

There are a variety of APIs for use with TCP/IP:

• Sockets

• TLI

• Winsock

• MacTCP

Dr. Ehab Al-Shaer/Network Programming

26

Functions needed

Specify local and remote communication endpoints

Initiate a connection

Wait for incoming connection

Send and receive data

Terminate a connection gracefully

Error handling

27

Berkeley Sockets

Generic:

• support for multiple protocol families.

• address representation independence

Uses existing I/O programming interface as

much as possible.

(10)

Dr. Ehab Al-Shaer/Network Programming

28

Unix Descriptor Table

Descriptor Table 0

1 2 3 4

Data structure for file 0

Data structure for file 1

Data structure for file 2

Dr. Ehab Al-Shaer/Network Programming

29

Socket

A socket is a process-level abstract representation of a communication endpoint.

Sockets work with Unix I/O services just like files, pipes & FIFOs.

Sockets (obviously) have special needs:

• establishing a connection

• specifying communication endpoint addresses

References

Related documents

IPv6 Network IPv4 Protocol Stack IPv6 Protocol Stack Socket 000 IPv4 Module IPv6 Module IMS-ALG TrGW Controller c h b a TrGW-1 NIC-2 Interface NIC-1 Interface SIIT NAT-PT Address

Bilateral international VoIP interconnections may occur using either IPv4 or IPv6 network protocols; in the context of this document IP refers to both IPv4 and IPv6

The findings provided support for different models depend- ing on the SAL domain and the cultural group, after controlling for autoregressive effects and the effects of

In addition to connecting the IPv6 network with the IPv6 Internet through the IPv4 network, the prefix is the same and the 6to4 router will encapsulate the IPv4

A teleradiology report should contain the type of the service (primary interpretation, second opinion etc.), the name of both the transmitting and receiving sites, the

 H3C S7500X switch series comes with IPv4/IPv6 dual-stack platform that provides sophisticated IPv4/IPv6 solutions by supporting multiple tunnels, IPv4/IPv6 Layer 3

Characterization Techniques Test Invasive/ Noninvasive Sample Recovered Usage Standard penetration test Invasive Yes Extensive Cone penetration test Invasive No Extensive

In this online study participants answered survey questions to determine their background and assess their knowledge about phishing, and completed a roleplay task to assess