37
计计计计•计计计计计计计 Lecture 16 Networking xlanchen@06/10/2005

计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

Embed Size (px)

Citation preview

Page 1: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

计算机系•信息处理实验室

Lecture 16 Networking

xlanchen@06/10/2005

Page 2: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

2计算机系信息处理实验室

Content

The OSI Reference Model

Networking APIs

Network-Resource Name Resolution

Protocol Drivers

NDIS Drivers

Binding

Layered Network Services

Page 3: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

3计算机系信息处理实验室

The OSI Reference Model

Open Systems Interconnection (OSI) reference model

7 layers

An idealized scheme

Page 4: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

4计算机系信息处理实验室

2K Networking Components

Networking APIs

protocol-independent

Transport Driver Interface (TDI) clients

kernel-mode device drivers

TDI transports

kernel-mode protocol drivers

NDIS library

Ndis.sys

NDIS miniport drivers

Page 5: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

5计算机系信息处理实验室

Networking APIs

Named pipes and mailslots

Windows Sockets (Winsock)

Remote procedure call (RPC)

Common Internet File System (CIFS)

NetBIOS

Page 6: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

6计算机系信息处理实验室

Named Pipes and Mailslots

Named pipes

Provide reliable bidirectional communications

Mailslots

Provide unreliable unidirectional data transmission

Support broadcast capability

Page 7: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

7计算机系信息处理实验室

Named pipe communications

\\Server\Pipe\PipeName| | | a unique name| | | (can include

subdirectories) | | “Pipe”| the computer

Example: \\MyComputer\Pipe\MyServerApp\ConnectionPipe

Page 8: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

8计算机系信息处理实验室

Named Pipe Operation

CreateNamedPipe

A pope operates in byte mode or message mode

ConnectNamedPipe

synchronously or asynchronously

CreateFile or CallNamedPipe

ReadFile and WriteFile (Win32 Func)

Establish the connection

Page 9: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

9计算机系信息处理实验室

Mailslot Operation

Name: \\Server\MailSlot\MailSlotName

Func: CreateMailSlot, ReadFile; CreateFile, WriteFile

Message size < 425 Bytes

Page 10: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

10计算机系信息处理实验室

Named Pipe and Mailslot Implementation

Name resolution: \\.\Pipe\PipeName

Npfs.sys Msfs.sys

Symbolic link: \\?\Pipe; \\?\MailSlot

Page 11: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

11计算机系信息处理实验室

EXPERIMENT

Listing the Named Pipe Namespace and Watching Named Pipe Activity

Page 12: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

12计算机系信息处理实验室

Windows Sockets

Microsoft's implementation of BSD Sockets

2K: Winsock 2.2

features

scatter-gather and asynchronous I/O

QoS conventions

Extensibility

integrated namespaces

multipoint messages

Page 13: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

13计算机系信息处理实验室

Winsock Operation

Support protocols

NetBEUI, TCP/IP, IPX

After initilization:

socket; bound; listen/connect/accept; recv/send

Page 14: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

14计算机系信息处理实验室

Winsock Implementation

Page 15: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

15计算机系信息处理实验室

Remote Procedure Call

Compatible with the OSF/DCE standard

procedural view VS. transport-centered view

Remote I/O request

OS : redirector|remote system, execute and

return|local: interrupt, & return to

caller

Page 16: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

16计算机系信息处理实验室

RPC Operation

Page 17: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

17计算机系信息处理实验室

RPC Implementation

Page 18: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

18计算机系信息处理实验室

Common Internet File System (CIFS)

A published Microsoft standard

An enhanced form of the Server Message Block (SMB) protocol

allows third parties to interoperate with 2K file servers and with 2K file sharing clients

E.g. Samba shareware

Redirector FSD

executes on a client machine & communicates with a server FSD

Page 19: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

19计算机系信息处理实验室

CIFS

Page 20: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

20计算机系信息处理实验室

Distributed File Caching

To provide a consistent view of shared remote file

2K solution: distributed cache coherency

Mechanism: oplock

Three main types of oplock

Level I oplock

Level II oplock

Batch oplock

Page 21: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

21计算机系信息处理实验室

Oplock example

Page 22: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

22计算机系信息处理实验室

NetBIOS

Network Basic Input/Output System

NetBIOS Names

16byte

2K: first 15 bytes of DNS name + modifier

LANA number

WINS

NetBIOS Names TCP/IP addresses

NetBIOS API

Listen, …

unique

group

Page 23: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

23计算机系信息处理实验室

EXPERIMENT

Using Nbtstat to See NetBIOS Names

Page 24: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

24计算机系信息处理实验室

NetBIOS API Implementation

Page 25: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

25计算机系信息处理实验室

Other Networking APIs Telephony API (TAPI)

DCOM

Message Queuing

Page 26: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

26计算机系信息处理实验室

Network-Resource Name Resolution

Multiple Provider Router

Multiple UNC Provider

Page 27: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

27计算机系信息处理实验室

Multiple Provider Router

Page 28: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

28计算机系信息处理实验室

Multiple UNC Provider

Page 29: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

29计算机系信息处理实验室

Domain Name System

Page 30: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

30计算机系信息处理实验室

Protocol Drivers

Page 31: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

31计算机系信息处理实验室

NDIS Drivers

Page 32: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

32计算机系信息处理实验室

Binding

Page 33: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

33计算机系信息处理实验室

Layered Network Services

Remote access

Active Directory

Network Load Balancing

File Replication service (FRS)

Distributed File System (DFS)

TCP/IP Extensions

Network Address Translation

Internet Protocol Security

Quality of Service

Page 34: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

34计算机系信息处理实验室

Active Directory architecture

Page 35: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

35计算机系信息处理实验室

Network Load Balancing operation

Page 36: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

36计算机系信息处理实验室

DFS components

Page 37: 计算机系 信息处理实验室 Lecture 16 Networking xlanchen@06/10/2005

xlanchen@06/10/2005 Understanding the Inside of Windows2000

37计算机系信息处理实验室

QoS architecture