BT1 MMT
BT1 MMT
BT1 MMT
ENGSUB
OSI Model or Open System Interconnection Model: OSI Model defines and is
used to understand How data is transferred from one computer to another in a
computer network? In the most basic form, two computers (end-points) connected to
each other with LAN Cable (Network Media) and connectors (RJ45) sharing data
with the help of NICs forms a network. But if one computer is based on Microsoft
Windows and the other one has MAC OS installed, then how these two computers are
going to communicate with each other? In order to accomplish successful
communication b/w computers or networks of different architectures, 7-layered OSI
Model or Open System Interconnection Model was introduced by International
Organization for Standardization in 1984 containing: Application Layer, Presentation
Layer, Session Layer, Transport Layer, Network Layer, Data Link Layer, Physical
Layer. Note that each layer is a package of protocols (set of rules and conventions). If
I say, Application Layer, then it does not mean that it includes computer applications
like Chrome, Firefox etc. But it includes application layer protocols that are needed to
make these applications work correctly in a network or Internet. Lets start with the
Top Most Layer. Application Layer: The application layer is used by network
applications. Network application means computer applications that use internet like
Google Chrome, Firefox, Outlook, Skype etc. Web Browser is a network application
running Not only web browser but all network applications including Outlook, Skype
etc. all are dependent on Application layer protocols to function. There are dozens of
application layer protocols that enable various functions at this layer. All these
protocols collectively form the Application layer. These protocols form the basis for
various network services like File transfer, Web surfing, Emails, Virtual terminals etc.
File transfer is done with the help of FTP protocol. Web surfing is done with the help
of HTTP or HTTPS For Emails, SMTP protocol is used, and For Virtual terminals,
TELNET is used. So, Application Layer provides services for network applications
with the help of protocols to perform users activities. Next to application layer is
Presentation Layer: Presentation Layer receives data from Application Layer. This
data is in the form of characters and numbers. Presentation Layer convert these
characters and numbers to machine-understandable binary format. Eg. Conversion of
ASCII to EBCDIC code. This function of Presentation layer is called Translation.
Before the data is transmitted, Presentation Layer reduces the number of bits that are
used to represent the original data. This bit reduction process is called Data
Compression and it can be Lossy or Lossless. Data Compression reduces the amount
of space used to store the original file. As the size of file is reduced, it can be received
at destination in very less time, i.e. data transmission can be done faster. Thus, data
compression is very helpful in real-time video or audio streaming. To maintain the
integrity of data, before transmission, data is encrypted. Encryption enhances security
of the sensitive data. At senders side, data is encrypted and at receivers side, data is
decrypted. SSL protocol (secure sockets layer) is used in Presentation Layer for
Encryption and Decryption. So, Presentation Layer performs 3 basic function:
Translation, Compression, and Encryption / Decryption. Now, Session Layer:
Suppose you have planned for a party. You have hired a few helpers ensuring that
each activity runs smoothly. Helpers will help you in setting up, assisting, cleaning
and then closing the party. Same is the case with Session Layer. Session Layer helps
in setting up and managing connections enabling sending and receiving of data
followed by termination of connections or sessions. Like you hired some helpers for
your party, Session layer too has its own helpers called APIs or Application
Programming Interfaces. NETBIOS or Network Basic Input/output System is an
example of APIs which allows applications on different computers to communicate
with each other. Just before a session or a connection is established with a server,
server performs a function called Authentication. Authentication is the process of
verifying, Who you are? For this, server uses a user name and password. Once entered
user name and password are matched, a session or a connection is established between
your computer and the server. Now, you can upload or download required files. After
authenticating the user, Authorization is checked. Authorization is the process used by
server to determine if you have permission to access a file. If not, you will get a
message saying, You are not authorized to access this page. Both of these functions,
Authentication and Authorization, are performed by session layer. The session layer
keeps a track of the files being downloaded. For example, a web page contains text,
images etc. These text and images are stored as separate files on the web server.
When you request for a website in your web browser, your web browser opens a
separate session to the web server to download each of these text and images files.
These files are received in the form of data packets. Session layer keeps a track of
which data packet belongs to which file, either text file or image file, and tracks
where the received data packet go, in this case, it goes to web browser, that is, session
layer helps in Session Management. So, session layer helps in: Session management,
Authentication, and Authorization. Your web browser performs all functions of
session, presentation and application layer. Layer below session layer is: Transport
Layer The transport layer controls the reliability of communications through
segmentation, flow control and error control. In segmentation, data received from
session layer is divided into small data units called segments. Each segment contains a
source and Destinations port number and a sequence number. Port number helps to
direct smaller data units to correct application. Sequence number helps to reassemble
smaller data units in the correct order to form correct message in the receiver. In Flow
control, Transport Layer controls the amount of data transmitted to a level that the
receiver can process. Consider our mobile connected to a server. Server can transmit
data maximum at 100 Mbps and Mobile can process data maximum at 10 Mbps. Now,
we are downloading a file from server but server starts sending data 50 Mbps which is
greater than the rate mobile phone can process. So, mobile phone, with the help of
Transport Layer, can tell the server to slow down data transmission rate up to 10
Mbps so that no data gets lost. Similarly, if server is sending data at 5 Mbps, mobile
phone tells server to increase data transmission rate to 10 Mbps to maintain system
performance. Transport Layer also helps in Error Control. If some data units do not
arrive the destination, transport layer uses Automatic repeat request (ARQ) schemes
to retransmit the lost or corrupted data. Checksum, a group of bits 1s and 0s, added to
each data segment by transport layer, is used to find out erroneous received data unit.
Protocols of Transport layer are Transmission Control Protocol (TCP) and User
Datagram Protocol (UDP). Transport Layer provides two types of services:
Connection-oriented Transmission and, Connectionless Transmission Connection-
oriented Transmission is done via TCP while Connectionless Transmission is done
via UDP. the feedback. Therefore, lost packets can be retransmitted in TCP. UDP is
used where it does not matter whether we have received all data. Eg. Streaming
movies, songs, online games, Voice over IP, TFTP, and DNS etc. On the other hand,
TCP is used where full data delivery is must. Eg. World Wide Web, Email, FTP etc.
So, transport layer performs segmentation, flow control, error control, connection and
connectionless transmission etc. Transport layer passes data segments to the Network
Layer: Network layer works for the transmission of received data segments from one
computer to another located in different networks. Segments in Network Layer are
called Packets. It is the layer where routers reside. The functions of the Network layer
are: 1. Logical Addressing 2. Routing 3. Path determination Logical Addressing: IP
addressing (IPv4 or IPv6) done in network layer is called Logical addressing. Every
computer in a network has a unique IP address. As network layer deals with data
delivery, so this layer assigns sender and receivers IP addresses to each data packet so
that each data packet can reach the correct destination. Routing Routing is a method
of moving a data packet from source to destination and it is based on the logical
address format of IPv4 or IPv6. Suppose, Computer A is connected to network 1 and
Computer B is connected to network 2. Network, in simple terms, means multiple
laptops or smartphones connected to a Home Router. From computer B, we have
requested to access facebook.com and now there is a reply from Facebook server for
computer B in the form of packet. This packet needs to be delivered to Computer B
only. Since, in a network, each device has a unique IP address, so these both
computers will be having a unique IP address as well. Network layer of Facebook
server have already added sender and receivers IP address in the packet. PLEASE
CORRECT !!!!!!! Mask is 255.255.255.0. This mask tells that the first 3 combination
represents network while the last combination represents host or Computer B. So,
based on IP address format, received data packet will move to network B1 and then to
computer B. So, based on IP address and mask, routing decisions are made in a
computer network. Path determination A computer can be connected to any internet
server or a computer in a number of ways. Choosing best possible path for data
delivery from source to destination is called Path Determination. Layer 3 devices use
protocols such as OSPF (Open Shortest Path First), BGP (Border Gateway Protocol),
IS-IS (Intermediate System to Intermediate System) to determine best possible path to
deliver data. Data Link Layer receive data packets from Network Layer which contain
IP addresses of sender and receiver. There are two kinds of addressing: - Logical
addressing - Physical addressing Logical addressing is done at network layer where
sender and receivers IP addresses are assigned to each data packet. Physical
addressing is done at Data Link layer where MAC addresses of both devices are
assigned to the received data packet. MAC address is a 12 digit alphanumeric number
embedded in NIC of your computer by the manufacturer. Data unit in Data link layer
is called Frame. Data Link Layer is embedded as a software in NIC of a computer and
provide means to transfer data from one computer to another via a local media. Local
media includes Copper wire, optical fiber or Air for radio signals. Please note, here
media does not corresponds to audio, video, animation etc. It refers to the physical
links between two or more computers or networks. The Data Link layer performs two
basic functions: - It allows the upper layers to access the media using techniques such
as framing. - Controls how data is placed and received from the media using
techniques such as media access control and error detection. Access the media:
Consider two distant hosts, a laptop and a desktop, communicating with each other.
As laptop and desktop are connected to different networks, so they will use Network
layer protocols, IP for example, to communicate with each other. In this example,
desktop is connected to Router R1 via an Ethernet Cable. Router R1 and R2 are
connected via a satellite link and laptop is connected to router R2 via a Wireless Link.
Now, desktop wants to send some data to Laptop. Based on the medium used to
connect desktop and Router R1, Data Link layer - embedded as software in NIC of
desktop adds some data in head and tail of IP packet and converts it to a frame, an
Ethernet frame in this case. Router R1 receives this Ethernet frame, de-capsulate it to
IP packet and then encapsulates it again to a frame so that it can cross satellite link to
reach router R2. Router R2 will again de-capsulate the received frame and re-
encapsulate based on the medium used to connect router R2 and laptop, wireless data
link frame in this case. Laptop receives wireless data link frame, de-capsulate and
then forward IP packet to Network layer and finally to application layer. Application
layer protocols then makes received data to be visible on computer screen. So,
network layer or higher level layers are able to transfer data over media, which are
LAN Cable and Air in this case, with the help of Data Link Layer. That is, Data Link
Layer provides access to media for higher layers of OSI Model. Data link layer
controls How data is placed and received from the media? Data Link Layer sends and
receives frame from the media. The technique used to get the frame on and off the
media is called Media Access Control. There may be a number of devices connected
to a common media. If two or more devices send data at the same time, then there
may be a possibility of the collision of the two messages resulting in a useless
message that neither recipient can understand. To avoid these situations, data link
layer keeps an eye on when the shared media is free so that device can transmit data
for the receiver. This is called Carrier Sense Multiple Access CSMA. So, Data Link
Layer, with its Media Access Control methods, controls when data is placed and
received from the media. Tail of each frame contains Bits which are used to detect
errors in the received frame. These occur due to certain limitations of media used for
transferring data. Physical Layer: Till now, data from application layer has been
segmented by Transport Layer, placed into packets by Network Layer and framed by
Data Link Layer which is a sequence of binary 0s and 1s. Physical Layer converts this
binary sequence into signals and transmit over local media. It can be an electrical
signal in case of Copper Cable or LAN cable, Light signal in case of Optical Fibre
and Radio signal in case of Air as Local Media. So, the signal generated by the
Physical Layer depends on the type of Media used to connect two devices. At receiver
side, Physical layer receive signals, convert it into bits and pass it to Data Link Layer
as a frame and then to higher layers, finally to application layer. Application layer
protocols makes the senders message visible in the application in the receivers
computer screen. So, these are 7 layers of OSI Model are lying behind the smooth
functioning of Internet.
VIETSUB
Mô hình OSI hoặc Mô hình kết nối hệ thống mở: Mô hình OSI xác định và được sử
dụng để hiểu Dữ liệu được truyền từ máy tính này sang máy tính khác trong mạng
máy tính như thế nào? Ở dạng cơ bản nhất, hai máy tính (điểm cuối) được kết nối với
nhau bằng Cáp LAN (Network Media) và đầu nối (RJ45) chia sẻ dữ liệu với sự trợ
giúp của NIC tạo thành một mạng. Nhưng nếu một máy tính chạy trên Microsoft
Windows và máy kia cài đặt MAC OS thì hai máy tính này sẽ giao tiếp với nhau như
thế nào? Để thực hiện thành công giao tiếp b/w máy tính hoặc mạng có kiến trúc khác
nhau, Mô hình OSI 7 lớp hoặc Mô hình kết nối hệ thống mở đã được Tổ chức tiêu
chuẩn hóa quốc tế giới thiệu vào năm 1984 bao gồm: Lớp ứng dụng, Lớp trình bày,
Lớp phiên, Lớp vận chuyển, Mạng Lớp, Lớp liên kết dữ liệu, Lớp vật lý. Lưu ý rằng
mỗi lớp là một gói giao thức (bộ quy tắc và quy ước). Nếu tôi nói, Lớp ứng dụng, thì
điều đó không có nghĩa là nó bao gồm các ứng dụng máy tính như Chrome, Firefox,
v.v. Nhưng nó bao gồm các giao thức lớp ứng dụng cần thiết để làm cho các ứng dụng
này hoạt động chính xác trong mạng hoặc Internet. Hãy bắt đầu với Lớp trên cùng.
Lớp ứng dụng: Lớp ứng dụng được sử dụng bởi các ứng dụng mạng. Ứng dụng mạng
có nghĩa là các ứng dụng máy tính sử dụng internet như Google Chrome, Firefox,
Outlook, Skype, v.v. Trình duyệt web là một ứng dụng mạng chạy Không chỉ trình
duyệt web mà tất cả các ứng dụng mạng bao gồm Outlook, Skype, v.v. Trình duyệt
web là một ứng dụng mạng chạy Không chỉ trình duyệt web mà tất cả các ứng dụng
mạng bao gồm Outlook, Skype, v.v. đều phụ thuộc vào các giao thức lớp Ứng dụng
để hoạt động. Có hàng chục giao thức lớp ứng dụng cho phép thực hiện nhiều chức
năng khác nhau ở lớp này. Tất cả các giao thức này cùng nhau tạo thành lớp Ứng
dụng. Các giao thức này tạo thành nền tảng cho các dịch vụ mạng khác nhau như
Truyền tệp, lướt Web, Email, Thiết bị đầu cuối ảo, v.v. Việc truyền tệp được thực
hiện với sự trợ giúp của giao thức FTP. Việc lướt web được thực hiện với sự trợ giúp
của HTTP hoặc HTTPS. Đối với Email, giao thức SMTP được sử dụng và Đối với
thiết bị đầu cuối ảo, TELNET được sử dụng. Vì vậy, Lớp ứng dụng cung cấp dịch vụ
cho các ứng dụng mạng với sự trợ giúp của các giao thức để thực hiện các hoạt động
của người dùng. Bên cạnh lớp ứng dụng là Lớp trình bày: Lớp trình bày nhận dữ liệu
từ Lớp ứng dụng. Dữ liệu này ở dạng ký tự và số. Lớp trình bày chuyển đổi các ký tự
và số này sang định dạng nhị phân mà máy có thể hiểu được. Ví dụ. Chuyển đổi mã
ASCII sang mã EBCDIC. Chức năng này của lớp Trình bày được gọi là Dịch thuật.
Trước khi dữ liệu được truyền đi, Lớp trình bày sẽ giảm số lượng bit được sử dụng để
thể hiện dữ liệu gốc. Quá trình giảm bit này được gọi là Nén dữ liệu và nó có thể bị
mất hoặc không mất dữ liệu. Nén dữ liệu làm giảm dung lượng được sử dụng để lưu
trữ tệp gốc. Khi kích thước của tệp giảm xuống, nó có thể được nhận ở đích trong thời
gian rất ngắn, tức là việc truyền dữ liệu có thể được thực hiện nhanh hơn. Do đó, nén
dữ liệu rất hữu ích trong việc truyền phát video hoặc âm thanh theo thời gian thực. Để
duy trì tính toàn vẹn của dữ liệu, trước khi truyền, dữ liệu sẽ được mã hóa. Mã hóa
tăng cường tính bảo mật của dữ liệu nhạy cảm. Ở phía người gửi, dữ liệu được mã hóa
và ở phía người nhận, dữ liệu được giải mã. Giao thức SSL (lớp ổ cắm bảo mật) được
sử dụng trong Lớp trình bày để mã hóa và giải mã. Vì vậy, Lớp trình bày thực hiện 3
chức năng cơ bản: Dịch, Nén và Mã hóa/Giải mã. Bây giờ, Lớp phiên: Giả sử bạn đã
lên kế hoạch cho một bữa tiệc. Bạn đã thuê một vài người trợ giúp để đảm bảo rằng
mỗi hoạt động diễn ra suôn sẻ. Những người giúp việc sẽ giúp bạn setup, hỗ trợ, dọn
dẹp và sau đó là kết thúc buổi tiệc. Tương tự là trường hợp với Lớp phiên. Lớp phiên
giúp thiết lập và quản lý các kết nối cho phép gửi và nhận dữ liệu sau đó chấm dứt kết
nối hoặc phiên. Giống như bạn đã thuê một số người giúp đỡ cho bữa tiệc của mình,
Lớp phiên cũng có các trình trợ giúp riêng được gọi là API hoặc Giao diện lập trình
ứng dụng. NETBIOS hoặc Hệ thống đầu vào/đầu ra cơ bản mạng là một ví dụ về API
cho phép các ứng dụng trên các máy tính khác nhau giao tiếp với nhau. Ngay trước
khi phiên hoặc kết nối được thiết lập với máy chủ, máy chủ sẽ thực hiện một chức
năng gọi là Xác thực. Xác thực là quá trình xác minh Bạn là ai? Đối với điều này,
máy chủ sử dụng tên người dùng và mật khẩu. Sau khi tên người dùng và mật khẩu đã
nhập trùng khớp, một phiên hoặc kết nối sẽ được thiết lập giữa máy tính của bạn và
máy chủ. Bây giờ, bạn có thể tải lên hoặc tải xuống các tập tin cần thiết. Sau khi xác
thực người dùng, Ủy quyền sẽ được kiểm tra. Ủy quyền là quá trình được máy chủ sử
dụng để xác định xem bạn có quyền truy cập tệp hay không. Nếu không, bạn sẽ nhận
được thông báo cho biết Bạn không được phép truy cập trang này. Cả hai chức năng
này, Xác thực và Cấp phép, đều được thực hiện bởi lớp phiên. Lớp phiên theo dõi các
tập tin đang được tải xuống. Ví dụ: một trang web chứa văn bản, hình ảnh, v.v. Những
văn bản và hình ảnh này được lưu trữ dưới dạng các tệp riêng biệt trên máy chủ web.
Khi bạn yêu cầu một trang web trong trình duyệt web của mình, trình duyệt web của
bạn sẽ mở một phiên riêng tới máy chủ web để tải xuống từng tệp văn bản và hình
ảnh này. Những tập tin này được nhận dưới dạng gói dữ liệu. Lớp phiên theo dõi gói
dữ liệu nào thuộc về tệp nào, tệp văn bản hoặc tệp hình ảnh và theo dõi nơi gói dữ liệu
nhận được, trong trường hợp này, nó sẽ chuyển đến trình duyệt web, nghĩa là lớp
phiên giúp Quản lý phiên. Vì vậy, lớp phiên giúp: Quản lý phiên, Xác thực và Cấp
phép. Trình duyệt web của bạn thực hiện tất cả các chức năng của lớp phiên, bản trình
bày và ứng dụng. Lớp bên dưới lớp phiên là: Lớp vận chuyển Lớp vận chuyển kiểm
soát độ tin cậy của truyền thông thông qua phân đoạn, kiểm soát luồng và kiểm soát
lỗi. Trong phân đoạn, dữ liệu nhận được từ lớp phiên được chia thành các đơn vị dữ
liệu nhỏ gọi là phân đoạn. Mỗi phân đoạn chứa một số cổng nguồn và đích và số thứ
tự. Số cổng giúp hướng các đơn vị dữ liệu nhỏ hơn đến đúng ứng dụng. Số thứ tự giúp
tập hợp lại các đơn vị dữ liệu nhỏ hơn theo đúng thứ tự để tạo thành thông báo chính
xác trong máy thu. Trong Kiểm soát luồng, Lớp vận chuyển kiểm soát lượng dữ liệu
được truyền đến mức mà người nhận có thể xử lý. Hãy xem xét điện thoại di động của
chúng tôi được kết nối với máy chủ. Máy chủ có thể truyền dữ liệu tối đa ở tốc độ 100
Mbps và Thiết bị di động có thể xử lý dữ liệu tối đa ở tốc độ 10 Mbps. Bây giờ, chúng
tôi đang tải xuống một tệp từ máy chủ nhưng máy chủ bắt đầu gửi dữ liệu với tốc độ
50 Mbps, lớn hơn tốc độ điện thoại di động có thể xử lý. Vì vậy, điện thoại di động,
với sự trợ giúp của Lớp vận chuyển, có thể yêu cầu máy chủ giảm tốc độ truyền dữ
liệu xuống tới 10 Mbps để không bị mất dữ liệu. Tương tự, nếu máy chủ đang gửi dữ
liệu ở tốc độ 5 Mbps, điện thoại di động sẽ yêu cầu máy chủ tăng tốc độ truyền dữ
liệu lên 10 Mbps để duy trì hiệu suất hệ thống. Lớp vận chuyển cũng giúp kiểm soát
lỗi. Nếu một số đơn vị dữ liệu không đến đích, lớp vận chuyển sẽ sử dụng sơ đồ Yêu
cầu lặp lại tự động (ARQ) để truyền lại dữ liệu bị mất hoặc bị hỏng. Tổng kiểm tra,
một nhóm bit 1 và 0, được thêm vào từng phân đoạn dữ liệu theo lớp truyền tải, được
sử dụng để tìm ra đơn vị dữ liệu nhận được sai. Các giao thức của lớp Transport là
Giao thức điều khiển truyền dẫn (TCP) và Giao thức gói dữ liệu người dùng (UDP).
Lớp vận chuyển cung cấp hai loại dịch vụ: Truyền hướng kết nối và Truyền không kết
nối Truyền hướng kết nối được thực hiện qua TCP trong khi Truyền không kết nối
được thực hiện qua UDP. lời phản hồi. Do đó, các gói bị mất có thể được truyền lại
trong TCP. UDP được sử dụng khi việc chúng tôi nhận được tất cả dữ liệu hay không
không quan trọng. Ví dụ. Truyền phát phim, bài hát, trò chơi trực tuyến, Thoại qua IP,
TFTP và DNS, v.v. Mặt khác, TCP được sử dụng khi phải phân phối dữ liệu đầy đủ.
Ví dụ. World Wide Web, Email, FTP, v.v. Vì vậy, lớp vận chuyển thực hiện phân
đoạn, kiểm soát luồng, kiểm soát lỗi, kết nối và truyền không kết nối, v.v. Lớp vận
chuyển chuyển các phân đoạn dữ liệu đến Lớp mạng: Lớp mạng hoạt động để truyền
các phân đoạn dữ liệu nhận được từ máy tính này sang máy tính khác nằm trong các
mạng khác nhau. Các phân đoạn trong Lớp mạng được gọi là Gói. Đây là lớp nơi các
bộ định tuyến cư trú. Các chức năng của lớp Mạng là: 1. Đánh địa chỉ logic 2. Định
tuyến 3. Xác định đường dẫn Địa chỉ logic: Đánh địa chỉ IP (IPv4 hoặc IPv6) được
thực hiện trong lớp mạng được gọi là Địa chỉ logic. Mỗi máy tính trong mạng có một
địa chỉ IP duy nhất. Vì lớp mạng xử lý việc phân phối dữ liệu nên lớp này chỉ định địa
chỉ IP của người gửi và người nhận cho từng gói dữ liệu để mỗi gói dữ liệu có thể đến
đúng đích. Định tuyến Định tuyến là phương pháp di chuyển gói dữ liệu từ nguồn đến
đích và nó dựa trên định dạng địa chỉ logic của IPv4 hoặc IPv6. Giả sử, Máy tính A
được kết nối với mạng 1 và Máy tính B được kết nối với mạng 2. Mạng, nói một cách
đơn giản, có nghĩa là nhiều máy tính xách tay hoặc điện thoại thông minh được kết
nối với Bộ định tuyến Gia đình. Từ máy tính B chúng ta đã yêu cầu truy cập
facebook.com và hiện tại đã có phản hồi từ máy chủ Facebook cho máy tính B dưới
dạng packet. Gói này chỉ cần được gửi đến Máy tính B. Vì trong một mạng, mỗi thiết
bị có một địa chỉ IP duy nhất nên cả hai máy tính này cũng sẽ có một địa chỉ IP duy
nhất. Lớp mạng của máy chủ Facebook đã thêm địa chỉ IP của người gửi và người
nhận trong gói. VUI LÒNG CHỈNH SỬA !!!!!!! Mặt nạ là 255.255.255.0. Mặt nạ này
cho biết rằng 3 tổ hợp đầu tiên đại diện cho mạng trong khi tổ hợp cuối cùng đại diện
cho máy chủ hoặc Máy tính B. Vì vậy, dựa trên định dạng địa chỉ IP, gói dữ liệu nhận
được sẽ chuyển sang mạng B1 rồi đến máy tính B. Vì vậy, dựa trên địa chỉ IP và mặt
nạ , các quyết định định tuyến được thực hiện trong mạng máy tính. Xác định đường
dẫn Một máy tính có thể được kết nối với bất kỳ máy chủ internet hoặc máy tính nào
theo một số cách. Việc chọn đường dẫn tốt nhất có thể để phân phối dữ liệu từ nguồn
đến đích được gọi là Xác định đường dẫn. Các thiết bị lớp 3 sử dụng các giao thức
như OSPF (Mở đường dẫn ngắn nhất trước), BGP (Giao thức cổng biên), IS-IS (Hệ
thống trung gian đến hệ thống trung gian) để xác định đường dẫn tốt nhất có thể để
phân phối dữ liệu. Lớp liên kết dữ liệu nhận các gói dữ liệu từ Lớp mạng chứa địa chỉ
IP của người gửi và người nhận. Có hai loại địa chỉ: - Địa chỉ logic - Địa chỉ vật lý
Địa chỉ logic được thực hiện ở lớp mạng nơi địa chỉ IP của người gửi và người nhận
được gán cho mỗi gói dữ liệu. Việc đánh địa chỉ vật lý được thực hiện ở lớp Liên kết
dữ liệu nơi địa chỉ MAC của cả hai thiết bị được gán cho gói dữ liệu nhận được. Địa
chỉ MAC là một số gồm 12 chữ số được nhà sản xuất nhúng vào NIC máy tính của
bạn. Đơn vị dữ liệu trong lớp Liên kết dữ liệu được gọi là Frame. Lớp liên kết dữ liệu
được nhúng dưới dạng phần mềm trong NIC của máy tính và cung cấp phương tiện để
truyền dữ liệu từ máy tính này sang máy tính khác thông qua phương tiện cục bộ.
Phương tiện truyền thông địa phương bao gồm dây Đồng, cáp quang hoặc Air cho tín
hiệu vô tuyến. Xin lưu ý, ở đây phương tiện không tương ứng với âm thanh, video,
hoạt ảnh, v.v. Nó đề cập đến các liên kết vật lý giữa hai hoặc nhiều máy tính hoặc
mạng. Lớp Liên kết dữ liệu thực hiện hai chức năng cơ bản: - Nó cho phép các lớp
trên truy cập phương tiện bằng cách sử dụng các kỹ thuật như đóng khung. - Kiểm
soát cách đặt và nhận dữ liệu từ phương tiện bằng các kỹ thuật như kiểm soát truy cập
phương tiện và phát hiện lỗi. Truy cập phương tiện: Hãy xem xét hai máy chủ ở xa,
một máy tính xách tay và một máy tính để bàn, đang giao tiếp với nhau. Vì máy tính
xách tay và máy tính để bàn được kết nối với các mạng khác nhau nên chúng sẽ sử
dụng các giao thức lớp Mạng, chẳng hạn như IP, để liên lạc với nhau. Trong ví dụ
này, máy tính để bàn được kết nối với Bộ định tuyến R1 thông qua Cáp Ethernet. Bộ
định tuyến R1 và R2 được kết nối qua liên kết vệ tinh và máy tính xách tay được kết
nối với bộ định tuyến R2 thông qua Liên kết không dây. Bây giờ, máy tính để bàn
muốn gửi một số dữ liệu đến Máy tính xách tay. Dựa trên phương tiện được sử dụng
để kết nối máy tính để bàn và Bộ định tuyến R1, lớp Liên kết dữ liệu - được nhúng
dưới dạng phần mềm trong NIC của máy tính để bàn sẽ thêm một số dữ liệu ở phần
đầu và đuôi của gói IP và chuyển đổi nó thành một khung, trong trường hợp này là
khung Ethernet. Bộ định tuyến R1 nhận khung Ethernet này, giải nén nó thành gói IP
và sau đó đóng gói lại thành một khung để có thể vượt qua liên kết vệ tinh để đến bộ
định tuyến R2. Bộ định tuyến R2 sẽ lại đóng gói khung nhận được và đóng gói lại dựa
trên phương tiện được sử dụng để kết nối bộ định tuyến R2 và máy tính xách tay,
khung liên kết dữ liệu không dây trong trường hợp này. Máy tính xách tay nhận
khung liên kết dữ liệu không dây, giải nén và sau đó chuyển tiếp gói IP đến lớp Mạng
và cuối cùng đến lớp ứng dụng. Các giao thức lớp ứng dụng sau đó làm cho dữ liệu
nhận được hiển thị trên màn hình máy tính. Vì vậy, lớp mạng hoặc các lớp cấp cao
hơn có thể truyền dữ liệu qua phương tiện, trong trường hợp này là Cáp LAN và
Không dây, với sự trợ giúp của Lớp Liên kết Dữ liệu. Nghĩa là, Lớp liên kết dữ liệu
cung cấp quyền truy cập vào phương tiện cho các lớp cao hơn của Mô hình OSI.
Kiểm soát lớp liên kết dữ liệu Dữ liệu được đặt và nhận từ phương tiện như thế nào?
Lớp liên kết dữ liệu gửi và nhận khung từ phương tiện. Kỹ thuật được sử dụng để bật
và tắt khung hình phương tiện được gọi là Kiểm soát truy cập phương tiện. Có thể có
một số thiết bị được kết nối với một phương tiện chung. Nếu hai hoặc nhiều thiết bị
gửi dữ liệu cùng lúc thì có khả năng xảy ra xung đột giữa hai tin nhắn dẫn đến một tin
nhắn vô dụng mà cả người nhận đều không thể hiểu được. Để tránh những tình huống
này, lớp liên kết dữ liệu sẽ theo dõi khi nào phương tiện dùng chung còn trống để thiết
bị có thể truyền dữ liệu cho người nhận. Đây được gọi là CSMA đa truy cập Carrier
Sense. Vì vậy, Lớp liên kết dữ liệu, với các phương thức Kiểm soát truy cập phương
tiện, sẽ kiểm soát thời điểm dữ liệu được đặt và nhận từ phương tiện. Đuôi của mỗi
khung chứa các Bit được sử dụng để phát hiện lỗi trong khung nhận được. Những
điều này xảy ra do những hạn chế nhất định của phương tiện được sử dụng để truyền
dữ liệu. Lớp vật lý: Cho đến nay, dữ liệu từ lớp ứng dụng đã được phân đoạn bởi Lớp
vận chuyển, được Lớp mạng đặt vào các gói và được đóng khung bởi Lớp liên kết dữ
liệu là một chuỗi các số 0 và 1 nhị phân. Lớp vật lý chuyển đổi chuỗi nhị phân này
thành tín hiệu và truyền qua phương tiện cục bộ. Nó có thể là tín hiệu điện trong
trường hợp Cáp đồng hoặc cáp LAN, Tín hiệu ánh sáng trong trường hợp Cáp quang
và Tín hiệu vô tuyến trong trường hợp Không khí là Phương tiện cục bộ. Vì vậy, tín
hiệu do Lớp vật lý tạo ra phụ thuộc vào loại Phương tiện được sử dụng để kết nối hai
thiết bị. Ở phía thu, lớp Vật lý nhận tín hiệu, chuyển đổi thành bit và chuyển đến Lớp
Liên kết Dữ liệu dưới dạng khung, sau đó đến các lớp cao hơn, cuối cùng là lớp ứng
dụng. Các giao thức lớp ứng dụng làm cho thông báo của người gửi hiển thị trong ứng
dụng trên màn hình máy tính của người nhận. Như vậy, đây là 7 lớp của Mô hình OSI
đằng sau sự vận hành trơn tru của Internet.