Upload
iame89
View
88
Download
0
Embed Size (px)
1
Chương 2: Network Services
2
Nội dung
Names and Addresses HOSTS File LMHOSTS Domain Name System Windows Internet Name Service (WINS) SMB and CIFS Mail Services Dynamic Host Configuration Protocol Dynamic DNS Active Directory Basics
3
Names and Addresses
name (hostname) indicates what we seek.
address (IP) indicates where it is.
names & numeric addr be used interchangeably route (tuyến)
indicates how to get there
Name are easier to remember and type correctly. Applications use IP addresses, but names are easier for humans to use
4
Names and Addresses
In most cases, hostnames and numeric addresses can be used interchangeably. User can ping the PC at IP address 172.16.12.2 by entering:
C:\ ping 172.16.12.2Or by enter the hostnames associated with the
address: C:\ping poop.example.com The system converts the hostname to an
address before the network connection is made.
5
Names and Addresses
to organize PC system names 2 common methods used
Flat namespace Sử dụng tên đơn giản để chỉ mỗi host. hostname phải là giá trị duy nhất trên mạng (must be
unique within network) Ví dụ: once the name pooh has been assigned to a
host, no other host on that network should be assigned that name.
6
Names and Addresses
to organize PC system names 2 common methods used
Hierarchical namespace Mạng chia nhỏ thành nhiều phần gọi là domain
(Subdivides network into multiple named parts called domains)
hostname Giá trị duy nhất trong một domain (unique within a domain) Nhưng có thể được nhân đôi trong các domain khác trên
cùng 1 mạng (but may be duplicated in other domains on the same network)
For example, a host named pooh.example.com and another host named pooh.oreilly.com may exist within the same network—in this case, the Internet.
7
Names and Addresses flat namespace is inadequate (không đầy
đủ) Tên có sẵn bị giới hạn (Limited name availability )
A good computer name is short, easily remembered, and meaningful. In a flat namespace, all the good computer names are taken quickly, and you find yourself assigning essentially random names to your hosts.
8
Names and Addresses
flat namespace is inadequate (không đầy đủ) Cần quản lý tập trung (Centralized administration
requirements) Gán quyền quản lý tập trung cho mỗi hostname có thể làm cho tiến trình xử lý chậm trể hoặc tẻ nhạt (The central authority assigns every hostname, which can be a slow tedious process)
9
Names and Addresses
10
HOSTS File
simple text file that associates IP addresses with hostnames Windows Server 2003 systems
%SystemRoot%\System32\Drivers\etc\hosts entry contains
IP address a list of hostnames associated with that address
Comments begin with #.
11
HOSTS File
NetBIOS
Mỗi máy tính trong mạng dùng hệ điều hành Microsoft đều có một tên NetBIOS duy nhất.
Mỗi tên NetBIOS chứa tối đa 16 ký tự
Tên NetBIOS có hai dạng: unique và group
Tên NetBIOS dễ nhớ và thân thiện hơn địa chỉ IP đối với người dùng
12
Cách xem NETBIOS:C1: Computername/ change/ moreC2: Run/ cmd / nbtstat –n (kiểm tra tên NETBIOS name máy mình)Nbtstat –a “IP máy khác”
Các loại NetBIOS Node
13
Các loại NetBIOS node định nghĩa các phương pháp phân giải tên NetBIOS sang địa chỉ IP Các loại NetBIOS node định nghĩa các phương pháp phân giải tên NetBIOS sang địa chỉ IP
Kiểu Node Diễn giải Registry
value
B-nodeDùng broadcast để đăng ký và phân giải tên NetBIOS
1
P-nodeChỉ dùng WINS để phân giải tên NetBIOS 2
M-nodeKết hợp B-node và P-node, nhưng B-node là mặc định 4
H-nodeKết hợp P-node và B-node, nhưng P-node là mặc định 8
14
LMHOSTS (Lan manager hosts)
Ánh xạ tên NetBIOS sang địa chỉ IP Trong %SystemRoot%\system32\drivers\etc Nội dung đối tượng của LMHOSTs (entry contains)
Địa chỉ IP (IP address) Tên của NetBIOS kết hợp với địa chỉ IP (1 NetBIOS name
associated with that address) Chú thích bắt đầu bằng ký tự # (comments begin with #).
Một vài tính năng không có trong file HOST (some features that not supported by HOSTS file)
#PRE The entry (entry in LMHosts file) preloaded into cache and
permanently retained there speed up for frequently used hostnames
#DOM: domain Xác định một máy chủ có thể xác nhận yêu cầu đăng nhập(Identifies a Windows server that can validate network logon
requests. ) #INCLUDE file
Specifies remote file that should be incorporated in local LMHOSTS file
15
LMHOSTS
reload with the nbtstat -R command
nbtstat -c cmd shows entries that are currently cached
16
HOSTS vs LMHOSTS
The original method of name resolution was to simply look up the hostname in a flat file called a host table. The file that contains TCP/IP hostnames is HOSTS, and the file that contains NetBIOS hostnames is LMHOSTS.
Now, however, both TCP/IP and NetBIOS support name servers. The database system used to translate TCP/IP hostnames to addresses is called Domain Name System (DNS). The name server system used for NetBIOS names is Windows Internet Name Service (WINS )
DNS
DNS là hệ thống tên miềm được phát minh vào năm 1984 cho Internet, được dùng để phân giải (đổi) tên miền (hostname) thành địa chỉ IP trong các mạng TCP/IP.
Ví dụ: Đổi “en.wikipedia.org” thành địa chỉ PI “66.230.200.100”
DNS được so sánh như “phone book” của Internet.
17
Cây phân cấp DNS
18
Cây phân cấp DNS
Ý tưởng: Phân phát trách nhiệm gán tên miền và ánh xạ chúng thành địa chỉ IP cho một server có thẩm quyền
Domain names sắp xếp thành một cây, cắt thành nhiều vùng, mỗi vùng được quản lý bởi một server cụ thể.
Không gian tên miền chứa một cây tên miền. Cây con chia thành nhiều vùng
Một vùng chứa tập hợp các node liên quan được quản lý bởi DNS nameserver chính thức
19
Cây phân cấp DNS
Mỗi node hay lá trên cây có 1 hay nhiều bảng nguồn, chứa thông tin liên quan đến tên miền
Một namespace đơn có thể làm chủ nhiều vùng.
20
21
Domain Name System (DNS)
Tổ chức thành cây phân cấp tương tự như cách tổ chức phân cấp của thư mục (organized into hierarchy similar hierarchy filesystem), bao gồm:
root domain top-level domains (TLD)
Geographic aside for country in the world (by a
2-letter: vn, fr, uk,jp,… organizational
com, edu, gov, mil, net, int, org (based on the type of organization)
22
Domain Name System
Domain name server 1 domain name thường chứa một hay
nhiều phần (nhãn), ngăn cách bởi dấu chấm. Nhãn phải nhất chuyển đến vùng cao nhất
(top-level domain) Mỗi nhãn cho đến phía trái định nghĩa sự
chia nhỏ hay là vùng con của vùng trên nó. Ví dụ: wikipedia.org biểu hiện vùng con của
vùng org; en.wikipedia.org biểu hiện vùng con của miền wikipedia.org.
23
Domain name server
Domain name server chứa 1 tập có phân cấp DNS server.
DNS server có quyền công bố tên miền và nameserver của những vùng dưới nó.
Sự phân cấp tầm kiểm soát của DNS server tương hợp với sự phân cấp miền.
24
25
WINS (Windows Internet Name Service)
- NetBIOS-over-TCP/IP (NetBT) là 1 thành phần mạng tích hợp sẵn trong Windows có nhiệm vụ phân giải tên từ NetBIOS name sang IP.
- Cơ chế phân giải NetBIOS name:
a). Sử dụng Broadcast.
b). Sử dụng WINS Server.
Giải pháp để không sử dụng Broadcast để hỏi địa chỉ IP của một máy tính trong mạng là sử dụng một máy chủ lưu
NetBIOS Name - địa chỉ IP của toàn bộ các máy tính trong mạng, máy chủ này được gọi là WINS Server.
Các thành phần của hệ thống WINS
Subnet 1
Subnet 2
Máy chủ dịch vụ WINSMáy chủ dịch vụ WINS
Cơ sở dữ liệu WINS Cơ sở dữ liệu WINS
WINS ProxyWINS Proxy
Máy khách dùng dịch vụ WINS Máy khách dùng dịch vụ WINS
How a WINS Client Registers and Releases NetBIOS Names
Máy khách g i yêu c u đăng ký t i máy ch WINS ở ầ ớ ủ
Máy ch WINS ghi nh n thông tin và g i l i thông s thông ủ ậ ở ạ ốbáo đã đăng ký thành công
Máy khách g i yêu c u đăng ký t i máy ch WINS ở ầ ớ ủ
Máy ch WINS ghi nh n thông tin và g i l i thông s thông ủ ậ ở ạ ốbáo đã đăng ký thành công
11
Máy khách yêu c u h y b tênầ ủ ỏ
Máy ch WINS g i xác nh n đã h y tênủ ở ậ ủ
Máy khách yêu c u h y b tênầ ủ ỏ
Máy ch WINS g i xác nh n đã h y tênủ ở ậ ủ22
WINS ClientWINS Client WINS ServerWINS Server
Name RegisteredName Registered
Name Released Name Released
How a WINS Server Resolves NetBIOS Names
Subnet 2
Subnet 1
Subnet 2
Máy chủ WINS AMáy chủ WINS A
Máy chủ WINS BMáy chủ WINS B
Máy kháchMáy khách
Máy khách liên lạc 3 lần với máy chủ WINS, nhưng không nhận đựơc hồi đápMáy khách liên lạc 3 lần với máy chủ WINS, nhưng không nhận đựơc hồi đáp11
Máy khách liên lạc tới tất cả các máy chủ WINS khác tới khi nào nhận được hồi đápMáy khách liên lạc tới tất cả các máy chủ WINS khác tới khi nào nhận được hồi đáp22
Sau khi phân gi i thành công, máy ch WINS tr k t qu l i cho ả ủ ả ế ả ạmáy kháchSau khi phân gi i thành công, máy ch WINS tr k t qu l i cho ả ủ ả ế ả ạmáy khách33
Liên lạc 3 lầnLiên lạc 3 lần
11
22
33
29
Resolving a NetBIOS name h-node WINS client resolve NetBIOS name to IP address in
following manner If WINS client cannot resolve name from its local cache
sends name query request to WINS server. contains the NetBIOS name of the computer to be resolved. WINS server returns IP address that WINS database maps to
NetBIOS name. client uses IP address to establish a session with target computer.
If WINS query fail client sends IP broadcast packet containing a name query request.
If target computer is on same subnet returns IP address to the querying computer and direct session is established.
If IP broadcast name query request fails to return an IP address, client examines its local LMHOSTS file , if local LMHOSTS contains an #INCLUDE statement pointing to a remote LMHOSTS file on a server, it examines remote LMHOSTS file as well.
Quá trình WINS Replication
WINS replication là quá trình sao chép cơ sở dữ liệu của WINS khi có sự thay đồi từ máy chủ WINS này sang máy chủ WINS khác
WINS replication là quá trình sao chép cơ sở dữ liệu của WINS khi có sự thay đồi từ máy chủ WINS này sang máy chủ WINS khác
Máy chủ WINS AMáy chủ WINS A
Subnet 2Subnet 1
Máy chủ WINS BMáy chủ WINS B
WINS ReplicationWINS Replication
Máy BMáy A
Cơ chế Push hoạt động ra sao
Subnet 2Subnet 1
WINS Server AWINS Server A WINS Server BWINS Server B
50 changes occur in database50 changes occur in database
11
Notification sentNotification sent22 Replication requestReplication request33 Replicas sentReplicas sent44
Subnet 2Subnet 1
Máy ch WINS AủMáy ch WINS Aủ Máy ch WINS BủMáy ch WINS Bủ
Máy chủ WINS sẽ nhắc nhở các máy chủ WINS khác là có sự thay đổi trong cơ sở dữ liệu của mìnhCơ chế Push đáp ứng nhu cầu đồng bộ hóa cho các đường truyền có băng thông lớn
Máy chủ WINS sẽ nhắc nhở các máy chủ WINS khác là có sự thay đổi trong cơ sở dữ liệu của mìnhCơ chế Push đáp ứng nhu cầu đồng bộ hóa cho các đường truyền có băng thông lớn
Máy chủ WINS A có 50 thay đổi trong cơ sở dữ liệuMáy chủ WINS A có 50 thay đổi trong cơ sở dữ liệu11Máy chủ WINS A nhắc nhở máy chủ WINS B về sự thay đổi nàyMáy chủ WINS A nhắc nhở máy chủ WINS B về sự thay đổi này22
Máy chủ WINS B yêu cầu đồng bộ hóaMáy chủ WINS B yêu cầu đồng bộ hóa33Máy chủ WINS A gởi xác nhận và bắt đầu đồng bộ hóaMáy chủ WINS A gởi xác nhận và bắt đầu đồng bộ hóa44
Cơ chế Pull hoạt động ra sao
Subnet 2Subnet 1
WINS Server AWINS Server A WINS Server BWINS Server BReplicas sentReplicas sent22 Requests changes every 8 hoursRequests changes every 8 hours11
Subnet 2Subnet 1
Máy ch WINS AủMáy ch WINS Aủ Máy ch WINS BủMáy ch WINS Bủ
Máy chủ WINS yêu cầu đồng bộ dữ liệu được cấu hình theo thời gianCơ chế Push đáp ứng nhu cầu đồng bộ hóa cho các đường truyền có băng thông lớn
Máy chủ WINS yêu cầu đồng bộ dữ liệu được cấu hình theo thời gianCơ chế Push đáp ứng nhu cầu đồng bộ hóa cho các đường truyền có băng thông lớn
Máy chủ WINS A được cấu hình đổng bộ sau một khoảng thời gian nhất địnhMáy chủ WINS A được cấu hình đổng bộ sau một khoảng thời gian nhất định11
Máy chủ WINS B đồng ý và bắt đầu quá trính đồng bộ hóaMáy chủ WINS B đồng ý và bắt đầu quá trính đồng bộ hóa22
33
SMB and CIFS
Server Message Block (SMB) protocol Windows file and printer sharing uses NetBIOS over TCP on port 139
Common Internet File System (CIFS) Microsoft extended and updated SMB extended to support Distributed File System (DFS) called Self Host and uses TCP port 445
NetBIOS networks have been traditionally used for file and printer sharing. The Windows file and printer sharing protocol is Server Message Block (SMB) protocol. For Microsoft Windows NT 4.0, Microsoft extended and updated SMB and rechristened it the Common Internet File System (CIFS).
34
SMB and CIFS
steps involved in sharing a file or printer using CIFS client resolves server name to IP address client establishes TCP connection to
server on port 139 when NetBIOS is used or on port 445 when Self Host is used
35
SMB and CIFS
ClientServer
SMB SESSION REQUEST
NEGOTIATE packet
NEGOTIATE REPLY packet
SESSION SETUP ANDX message
SESSION SETUP ANDX message new UID
session parameters, authe
TREE CONNECT packet
TREE CONNECT RESPONSE TreeID
Access using UID, TID
36
Dịch vụ Mail (Mail Services)
Các giao thức cơ bản (basic protocols ) Simple Mail Transfer Protocol (SMTP )
TCP/IP mail delivery protocol Post Office Protocol (POP )
move user's mail from server to user's local mail reader
Internet Message Access Protocol (IMAP ) same basic service as POP and adds features to
support mailbox synchronization Multipurpose Internet Mail Extensions-MIME
extends the definition of what constitutes mail
37
SMTP (Simple Mail Transfer Protocol)
Giao thức tin cậy chịu trách nhiệm phân phát mail.
Là một dịch vụ hướng kết nối (connection-oriented service)
Hoạt động dựa trên chuẩn giao thức TCP, số hiệu cổng (port) hoạt động là 25.
38
SMTP (Simple Mail Transfer Protocol)
Các tập lệnh của SMTP
39
SMTP Để sử dụng các lệnh trên ta dùng lệnh telnet (illustrate how
mail is delivered between systems)telnet mail.example.com 25
40
POP
Có 2 phiên bản của POP (Post Office Protocol) được sử dụng rộng rãi là POP2, POP3. POP2 dùng cổng 109; POP3 dùng cổng 110.
Các câu lệnh trong hai giao thức POP2, POP3 này không giống nhau nhưng chúng cùng thực hiện chức năng cơ bản là kiểm tra tên đăng nhập và mật khẩu của người dùng và chuyển mail của người dùng từ Server tới hệ thống đọc mail cục bộ của user.
41
POP
client implementation in the Outlook
mailer server
implementation as part of mail server role available through Windows Server 2003 Configure Your Server wizard
42
POP illustrates how a POP protocol works
telnet mail.example.com 110
43
POPCác tập lệnh trong POP3
44
IMAP (Internet Message Access Protocol)
IMAP (IMAP 4,IMAP 2 ) port is TCP 143. Port 220 is used by IMAP 3
45
IMAP
46
MIME
MIME is extension of the original TCP/IP mail system, not a replcement for it. MINE is more concerned with what the mail system delivers than it’s with the mechanics of delivery.
Structure of the mail message carried by SMTP is defined in RFC 822
MIME extends RFC 822 into 2 areas Support for various data types
RFC 822 only transfers 7-bit ASCII data Support for complex message bodies
Content-Type header and Content-Transfer-Encoding header
47
MIME
48
DHCP (Dynamis Host Configuration Protocol)
to control TCP/IP configuration from a central point.
49
Dynamic DNS
permits a DNS server to be dynamically updated by the DHCP server or client
uses a 5-field format for DNS queries and responses
Microsoft integrates DHCP on both client and server with Microsoft DNS, WINS, and Active Directory.
50
Active Directory Basics
hierarchical structure Container
contain other objects.Ex : Computers and Users Domain
logical collection of computers that includes at least one domain controller.
Domain controller stores a copy of Active Directory database for its
domain and specialized software provides domain services and centralized management capabilities.
51
Active Directory Basics
Domain naming Windows 2000 and Windows Server 2003 domains are
named using DNS formatted names consisting of a name and extension.
If the organization has a registered DNS name it may chose to use this name as the name of a tree root domain in its Active Directory forest, but it does not have to.
Tree hierarchical collection of domain controllers in same DNS
domain namespace. Forest
composed of 1 or more Windows domains arranged in 1 or more trees.
created when the first DC in the first domain of the forest is created. This first domain is called the forest root domain.
52
Active Directory Basics
53
OU
Active Directory domains may contain Organizational Units (OUs ). OUs are containers that subdivide domains. used to separate users and groups OU can contain objects such as users,
groups and other OUs. domain has a single default OU, domain
controllers OU, which by default contains every DC in the domain
54
Site
sites are used to represent the physical structure of the forest
defined in Active Directory by identifying one or more IP subnets
can contain one or more DCs from a single domain and/or one or more DCs from multiple domains
55
Site
56
Active Directory Database Basics
Windows server becomes a DC default Active Directory database installed
57
Update change
change in Active Directory replicas of Active Directory using DC updated on DCs and global catalog (GC)
servers GC contains
forest-wide Active Directory database First DC of forest
Made GC server
58
DC (Domain Controller) Some AD data can only be managed by specific DCs
in the forest called operations masters
Roles Schema master
Controls management of schema objects. Domain-naming master
Controls addition or removal of domains in forest RID master
Allocates a series of relative IDs (RIDs) to each DC in a domain PDC emulator master
Windows NT Primary Domain Controller (PDC) when Window NT 4.0 computers are domain members
Infrastructure master Updates references from its domain's objects to objects in other
domains
59
Authentication, Authorization, Trusts
User needs to authenticate or identity on network must locate a DC in its domain
access to forest-wide resources authorization
accounts in 1 domain can be assigned access to resources in another domain domain trusts another domain
60
Authentication, Authorization, Trusts
Trusts in Windows 2000 and Windows Server 2003 domains Kerberos style
network authentication technique for users and computers in 1 AD domain
Transitive trust exists between domain A - domain B and domain
B-domain C domain A also trusts domain C Two-way
If a trust exists domain A and domain B, a trust also exists between domain B and domain A
61
Group Policy Basics
Group Policy used to deliver software installation,
config settings selected users and PC with accounts in AD domain
consists 1 Group Policy engine
interactions between server-side elements of GP and local application
client-side extensions
62
Group Policy Basics
server-side elements Group Policy Objects (GPOs),
store config settings. used to configure thousands of systems
automatically 2 default GPOs
Default Domain Controllers Policy Default Domain Policy.
Resultant Set of Policy (RSoP), tool to review effect of proposed or actual Group
Policy settings for specific computers and clients. resultant review is stored and can be examined later.
Administrative tools
63
Group Policy Basics
process steps from GPO creation to application GPO is created, edited, and linked to a site, domain, or
OU object. If a PC account resides within the object and PC portion of
the GPO is enabled config settings are downloaded and applied at PC boot.
If a user account resides within the object and user portion of the GPO is enabled, config settings are downloaded and applied during logon.
Changes to GPO settings are periodically refreshed, applied and will not wait for user logoff/logon or PC shutdown and start.
Security Settings config is periodically applied (every 13 hours) whether or not there are changes.
64
Group Policy Basics
GPOs that may impact a user or PC are applied in a top-down hierarchical fashion. First, any GP Settings on local PC are applied Next those on the site object, followed by
those linked to domain, OU, and any nested OU objects
Until account container is reached. If a conflict exists between the Security Setting
or Administrative Template setting during the application of multiple GPOs, the setting in the GPO closest to the account wins.
no conflict exists, all settings are cumulatively applied.
65
Group Policy Basics Constraints and filters
Enabled/Disabled PC and/or user section of GPO must be enabled in order for
that section to be applied. Security Filter
user or PC account must have Read and Apply Group Policy permission on GPO.
default, Authenticated Users group has these permissions. However, GP administrator can configure permissions so that
only certain groups of PC or users can apply WMI Filter
Windows Management Instrumentation (WMI) filter can be used to prevent a GPO from being applied to computers that have specific features detectible through WMI.
supports monitoring and management of system resources. can detect whether a PC has a specific feature and prevent
GPO application based on that information.
66
Group Policy Basics
Block Inheritance domain or OU has Block Inheritance property, GPOs
at a higher level in GPO hierarchy are not applied. Enforced (Override)
GPO is applied regardless of any use of Block Inheritance feature.
Loopback policy that reapplies user portion of PC GPO settings
to a PC after application of user based policy. This means that there is a consistent user policy in
place on the computer. useful for kiosk and other publicly available PC where
privileges of the user logged on should have no bearing on application of Group Policy restrictions.
67
Group Policy Basics
Local GPO information stored on client computer Windows\system32\Group Policy folder
Active Directory-based GPOs stored partially in AD and partially in DC filesystem.
GPO properties recorded in AD Administrative template .adm files and the Security
Settings .inf files %systemroot%\SYSVOL\sysvol\<domainname>\
Policies