计计计计•计计计计计计计 Lecture 16 Networking xlanchen@06/10/2005
Jan 10, 2016
计算机系•信息处理实验室
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
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
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
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
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
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
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
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
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
xlanchen@06/10/2005 Understanding the Inside of Windows2000
11计算机系信息处理实验室
EXPERIMENT
Listing the Named Pipe Namespace and Watching Named Pipe Activity
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
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
xlanchen@06/10/2005 Understanding the Inside of Windows2000
14计算机系信息处理实验室
Winsock Implementation
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
xlanchen@06/10/2005 Understanding the Inside of Windows2000
16计算机系信息处理实验室
RPC Operation
xlanchen@06/10/2005 Understanding the Inside of Windows2000
17计算机系信息处理实验室
RPC Implementation
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
xlanchen@06/10/2005 Understanding the Inside of Windows2000
19计算机系信息处理实验室
CIFS
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
xlanchen@06/10/2005 Understanding the Inside of Windows2000
21计算机系信息处理实验室
Oplock example
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
xlanchen@06/10/2005 Understanding the Inside of Windows2000
23计算机系信息处理实验室
EXPERIMENT
Using Nbtstat to See NetBIOS Names
xlanchen@06/10/2005 Understanding the Inside of Windows2000
24计算机系信息处理实验室
NetBIOS API Implementation
xlanchen@06/10/2005 Understanding the Inside of Windows2000
25计算机系信息处理实验室
Other Networking APIs Telephony API (TAPI)
DCOM
Message Queuing
xlanchen@06/10/2005 Understanding the Inside of Windows2000
26计算机系信息处理实验室
Network-Resource Name Resolution
Multiple Provider Router
Multiple UNC Provider
xlanchen@06/10/2005 Understanding the Inside of Windows2000
27计算机系信息处理实验室
Multiple Provider Router
xlanchen@06/10/2005 Understanding the Inside of Windows2000
28计算机系信息处理实验室
Multiple UNC Provider
xlanchen@06/10/2005 Understanding the Inside of Windows2000
29计算机系信息处理实验室
Domain Name System
xlanchen@06/10/2005 Understanding the Inside of Windows2000
30计算机系信息处理实验室
Protocol Drivers
xlanchen@06/10/2005 Understanding the Inside of Windows2000
31计算机系信息处理实验室
NDIS Drivers
xlanchen@06/10/2005 Understanding the Inside of Windows2000
32计算机系信息处理实验室
Binding
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
xlanchen@06/10/2005 Understanding the Inside of Windows2000
34计算机系信息处理实验室
Active Directory architecture
xlanchen@06/10/2005 Understanding the Inside of Windows2000
35计算机系信息处理实验室
Network Load Balancing operation
xlanchen@06/10/2005 Understanding the Inside of Windows2000
36计算机系信息处理实验室
DFS components
xlanchen@06/10/2005 Understanding the Inside of Windows2000
37计算机系信息处理实验室
QoS architecture