Home

Network Basic Theory 8 (Data Link)

Leave a comment

Hmmm….Layer 5,6,7 udah…Transport yang Layer 4 udah, Network di Layer 3 udah

Kali ini kita akan belajar yang namanya Data Link…dimana tuh ?? Layer 2

Data Link menyediakan pengaturan untuk exchanging data over local media (Layer Data Link menyediakan service untuk mensupport proses komunikasi dari setiap medium ketika data di transmit/dikirim)

2 Service Basic/Dasar dari Data Link Layer adalah:

  • Allows the upper layers to access the media using techniques such as framing
  • Controls how data is placed onto the media and is received from the media using techniques such as media access control (MAC) and error detection

Terminologi2 yang ada di Layer 2 – Data Link

  • Switch: Alat ini BIASA nya ada di layer 2 (walaupun switch2 “canggih” bisa di Layer 3), contoh Layer 2: Switch Cisco Catalyst 2950, Layer 3 Switch / Multilayer Switch: Switch Cisco Catalyst 3650.
  • Frame: PDU dari Data Link Layer (remember *encapsulation)
  • Node: istilah Layer 2 untuk network devices yang terkoneksi dengan media yang sama (media penghantar yang sama)
  • Media/medium (physical) – The physical means for the transfer of information between two nodes
  • Network (physical) – Two or more nodes connected to a common medium


Data Link Layer – Frame

Protocol Data Link layer require control information untuk membuat protocol bekerja. Control information may tell:

  • Which nodes are in communication with each other
  • When communication between individual nodes begins and when it ends
  • Which errors occurred while the nodes communicated
  • Which nodes will communicate next

The Data Link layer prepares a packet for transport across the local media by encapsulating it with a header and a trailer to create a frame.

Data Link layer frame includes:

  • Data – The packet from the Network layer
  • Header – Contains control information, such as addressing, and is located at the beginning of the PDU
  • Trailer – Contains control information added to the end of the PDU

Bahasa mudahnya adalah : Data Link layer bertugas menghubungkan antara physical/hardware layer dengan logical/software layer (network layer keatas) dengan menyediakan protocol, encapsulasi, dll

Data Link Sub Layer

  1. Upper Layer : defines the software processes that provide services to the Network layer protocols –> LLC (Logical Link Control)
  2. Lower Layer : defines the media access processes performed by the hardware –> MAC (Media Access Control)

Memisahkan Data Link Layer kedalam sublayer memungkinkan 1 tipe frame di define oleh upper layer (seperti Network Layer) untuk mengakses different type of medium yang di define oleh lower layer (Physical layer), Such is the case in many LAN technologies, including Ethernet

Let’s see these sublayers in brief view:

  1. Logical Link Control

    Logical Link Control (LLC) menaruh informasi di frame yang mengidentifikasikan Network layer protocol mana yang sedang digunakan di frame. This information allows multiple Layer 3 protocols, such as IP and IPX, to utilize the same network interface and media.

  2. Media Access Control

    Media Access Control (MAC) provides Data Link layer addressing and delimiting of data according to the physical signaling requirements of the medium and the type of Data Link layer protocol in use. Mengatur placement data frame kedalam media

Media Access Control (MAC) berguna untuk mendefinisikan proses2 apa sajakah dari setiap network device yang bisa mengakses network media dan mentransmit frames di lingkungan network yang berbeda.

Media Access Control tuh kek ibarat Aturan2 Lalu Lintas yang mengatur keluar masuknya kendaraan di jalan raya. Ketidak hadiran dari MAC ini akan berakibat kendaraan2 yang ada memasuki jalan raya tanpa perduli dengan kendaraan lain (bodo amat beybeh)

Tapi, tidak semua jalan raya dan entrance itu sama. Traffic di jalan raya (kendaraan2) dapat memasuki jalan dengan merging (1 jalan digabung), pake lampu lalu lintas (biar ga macet). Pengemudi mengikuti set aturan2 dari jalan2 yang ada (klo jalannya hanya bole 1 arah…ya satu arah…jgn ngelawan arah 😛 )

The method of media access control used depends on:

  • Media sharing – If and how the nodes share the media
  • Topology – How the connection between the nodes appears to the Data Link layer

Standard2 dalam Data Link Layer

There are two basic media access control methods for shared media:

  • Controlled – Each node has its own time to use the medium
  • Contention-based – All nodes compete for the use of the medium

CSMA: Carrier Sense Multiple Access, Sebuah protocol dimana node yang mo mentransmit data harus men-“listen” sinyal carrier (yaitu sinyal yang menandakan bahwa ada node lain yang lagi transmit data), jika ada…maka node tersebut nunggu sampe sinyal itu hilang/tidak ada

  • CD : Collision Detection

    Contohnya adalah CSMA itu sendiri

  • CA : Collision Avoidance

    Bedanya adalah, ketika sinyal carrier ga ada, host yang intent to send data, kirim pesan “HOI, gw mo kirim data, jgn ada yang make yaaaa” wkwkkw (CSMA/CD = jika sinyal ga ada…langsung try sending, ga pake tegor2an dulu)

There are two basic media access control methods for non-shared media:

  • Half Duplex: (pake gambar aja de..males gw ngetiknya)

  • Full Duplex:

Membahas data link berarti membahas pula tentang topology, khususnya Logical Topology

  • The physical topology is an arrangement of the nodes and the physical connections between them. The representation of how the media is used to interconnect the devices is the physical topology (configurasi kabel, PC, dan alat2 jaringan)
  • A logical topology is the way a network transfers frames from one node to the next. This arrangement consists of virtual connections between the nodes of a network independent of their physical layout. These logical signal paths are defined by Data Link layer protocols. The Data Link layer “sees” the logical topology of a network when controlling data access to the media. It is the logical topology that influences the type of network framing and media access control used.

P2P Connection

*Sory untuk Multi Access (pake flash…susah T_T)

Ring Topology Connection (sama ini juga…pake Flash -_-; )

Data Link – Header & Trailer

Typical frame header fields include:

  • Start Frame field – Indicates the beginning of the frame
  • Source and Destination address fields – Indicates the source and destination nodes on the media
  • Priority/Quality of Service field – Indicates a particular type of communication service for processing
  • Type field – Indicates the upper layer service contained in the frame
  • Logical connection control field – Used to establish a logical connection between nodes
  • Physical link control field – Used to establish the media link
  • Flow control field – Used to start and stop traffic over the media
  • Congestion control field – Indicates congestion in the media

The field names above are nonspecific fields listed as examples. Different Data Link layer protocols may use different fields from those mentioned. Because the purposes and functions of Data Link layer protocols are related to the specific topologies and media, each protocol has to be examined to gain a detailed understanding of its frame structure.


Data Link Frame Trailer

How Data Link Works

Pake gambar aja….

  1. Laptop Ngirim Data ke Komputer yang paling ujung…Laptop terhubung ke wireless Access Point (AP)…Data Link yang dipakai adalah data link Wireless Frame

  1. AP terhubung ke Router…Data Link Frame yang dipakai adalah PPP Frame (Point-to-Point Protocol) ke Router

  1. Router kirim Frame ke Router dengan Frame HDLC (High-level Data Link Control, propiertary Cisco, its seems…Both router are Cisco then 😛 )

  1. Router yang ke 2, setelah menerima data link frame HDLC, mengirimkan frame over internet (cloud = Internet) dengan metode Frame Relay

  1. Sisanya ke Router à Ke Switch à Ke Komputer memakai Ethernet Frame

Sebenernya gw mau bahas tentang Ethernet…tapi di Cisco sendiri ada 1 BAB KHUSUS untuk ini..so nanti aja gw jelasin

Next…gw mo kasi mini-guide (bergambar) tentang Follow Data Through Internetwork

Network Basic Theory 5 (Transport Layer Protocols)

1 Comment

Inti dari transport Layer adalah untuk untuk mengatur pertukaran data dari setiap aplikasi ke masing2 end devices yang saling terhubung

Fungsi lain dari Transport Layer adalah :

  • Memungkinkan setiap aplikasi untuk berkomunikasi dengan jaringan melalui alat/end device yang sama
  • Jika diperlukan, menjaga data diterima dengan baik oleh aplikasi yang membutuhkan (reliable & connection oriented conversation)
  • Menerapkan error-handling mechanism
  • Encapsulasi/Decapsulasi (segment/de-segment) data…membuat data rekonstruksi/dekonstruksi
  • Mengawasi komunikasi individual antar setiap aplikasi di host sumber dan di host
  • Mengidintifikasi data aplikasi yang berbeda…which is Port Number
  • Flow Control

*bayangkan kita pake video steaming….yang kita terima adalah data e-mail, kita lagi e-mail…yang kita terima adalah data dari aplikasi lain…disini lah transport layer bekerja…ensure the right data delivers to the right application that needed

————————————————————————————————————————————————————————————

————————————————————————————————————————————————————————————

————————————————————————————————————————————————————————————

————————————————————————————————————————————————————————————

Supporting Reliable Communication

3 hal dasar dari reliabilitas transport layer :

  1. Tracking transmitted data
  2. Acknowledging received data
  3. Retransmitting an unacknowledged data

Aplikasi apa aja sih yang butuh reliabilitas dalam transfer data ??

  • Email (lo bayangin klo data email yg lo terima ngaco alias error)
  • Web Page (lo lagi baca manga online, gambarnya ga keluar ato setengah2 *angry*)
  • Database
  • Etc…

Yang ga terlalu butuh reliabilitas apa aja ??

  • VoIP
  • Video Streaming (VoIP dan Streaming…kalau data segment ada yang hilang…akibatnya Cuma delay alias buffering)
  • DNS (Domain Name System)
  • Etc…

*ya tetep aja kalau ilangnya banyak bufferingnya lama doooonk ?!?!? ya itu si DL (derita loe) *kidding*

————————————————————————————————————————————————————————————

UDP and TCP

  • User Datagram Protocol (UDP)
    • UDP is a simple, connectionless protocol, described in RFC 768. It has the advantage of providing for low *overhead data delivery. The pieces of communication in UDP are called datagrams. These datagrams are sent as “best effort” by this Transport layer protocol.
      • Applications that use UDP : VoIP, DNS, Streaming Media
  • Transfer Control Protocol (TCP)
    • TCP is a connection-oriented protocol, described in RFC 793. TCP incurs additional overhead to gain functions. Additional functions specified by TCP are the same order delivery, reliable delivery, and flow control. Each TCP segment has 20 bytes of overhead in the header encapsulating the Application layer data, whereas each UDP segment only has 8 bytes of overhead.
      • Applications that use TCP : E-mail, Web Browser, File Transfer

*overhead maksud gampangnya bisa kita liat gambar diatas, lebih banyak data yang dikirim…lebih besar juga makan bandwidth

Dilihat dari gambar diatas…gw akan jelasin beberapa (dari TCP nya aja)

Sequence Number : nomor urut paket (kan klo dipecah2 gimana cara nyambungnya klo ga ada nomor urutnya??)

Ack Number : its say “okay..your packet is delivered…thanks”

Checksum : flow control…error engga ?? data yang di terima komplit engga ?

Option : gw kurang tau ini…tapi mungkin..ya opsi2 tambahannya kali yah J

The combination of the Transport layer port number and the Network layer IP address assigned to the host uniquely identifies a particular process running on a specific host device. This combination is called a socket

For example, an HTTP web page request being sent to a web server (port 80) running on a host with a Layer 3 IPv4 address of 192.168.1.20 would be destined to 192.168.1.20:80. ß THIS CALLED SOCKET !!

“Petugas” yang mengatur Port Number adalah organisasi yang dinamakan Internet Assigned Numbers Authority (IANA).

Ada 3 tipe port number :

  1. Well Known Port (port 0 sampai 1023), yaitu port2 yang biasa dipakai dalam transfer data sehari2 seperti e-mail port, chat port, web browser port, dll
  2. Registered Port (port 1024 sampai 49151), These port numbers are assigned to user processes or applications. These processes are primarily individual applications that a user has chosen to install rather than common applications that would receive a Well Known Port. When not used for a server resource, these ports may also be used dynamically selected by a client as its source port.
  3. Dynamic and/or Private Port : (port 49152 sampai 65535), Also known as Ephemeral Ports, these are usually assigned dynamically to client applications when initiating a connection. It is not very common for a client to connect to a service using a Dynamic or Private Port (although some peer-to-peer file sharing programs do).

A current list of port numbers can be found at IANA Website

————————————————————————————————————————————————————————————

Sekarang kita coba untuk melihat port number dan tipe koneksinya (UDP atau TCP ? ) melalui fitur Netstat di command prompt

  1. Tipe koneksi : TCP
  2. Source Port Number : 3126…diliat dari tipe port diatas, berarti ini adalah registered port
  3. Address host
  4. Destionation Port Number : HTTP
  5. Connection State
  6. Dan satu lagi 207.138.126.152:http ßSocket

————————————————————————————————————————————————————————————

Perbedaan TCP dan UDP

Penjelasan :

  • TCP terdiri dari 32 bit (lihat paling atas…bit 0-15-31)
  • Source Port Number : port tempat data asal di kirimkan (kata Cisco biasanya port random dari angka 1023 keatas)
  • Destination Port Number : port tempat aplikasi tujuan
  • Sequence Number : nomor paket…biar pas sampai ke tempat tujuan, ngurutinnya gampang, kan multiplexing (liat lagi Network Basic Theory 2), alias di pecah2 pas mo dikirim, biar beban jaringan ga berat
  • Ack Number : specified next octet “expected” by receiver…alias klo packet pertama sudah, packet kedua yang akan di tunggu, disinilah “ack” fungsinya…”ok…paket pertama sudah diterima…paket kedua nya gw tunggu ya..”
  • H. Length : Header Length…seberapa besar length alias byte yang dipakai untuk segment header
  • Reserved : reserved for future use…I guess 😀
  • Flags : menandakan session management…penjelasan nanti dibawa
  • Window Size : seberapa banyak oktet yang akan dikirim sebelum menunggu tanda “ack”… baca lebih lanjut penjelasannya dibawah tentang window size(berikut gambar)
  • TCP Checksum : used for error-checking
  • Urgent Pointer : URG…same…don’t know very much
  • Option : jika ada data2 tambahan
  • Data : data segment nya…data aplikasi nya tentu saja

One way to improve security on a server is to restrict server access to only those ports associated with the services and applications that should be accessible to authorized requestors.

————————————————————————————————————————————————————————————

Membangun Komunikasi antar device : The Three Way Handshake

  • Establishes that the destination device is present on the network
  • Verifies that the destination device has an active service and is accepting requests on the destination port number that the initiating client intends to use for the session
  • Informs the destination device that the source client intends to establish a communication session on that port number

Dalam koneksi TCP, host yang berfungsi sebagai client meng-inisialisasi session ke server. The three steps in TCP connection establishment are:

  1. Client yang meng-inisialisasi mengirimkan sebuah segment yang berisi initial sequence value (nilai sequence awal), yang mana berfungsi untuk merequest ke server untuk memulai sesi komunikasi…“bos…hallo…bisa ngobrol sebentar ga ?!?!”
  2. Server merespon dengan mengirimkan segment yang berisi ack value yang nilainya sama dengan received sequence value ditambah 1, dan juga ditambah dengan synchronizing sequence value dari server itu sendiri. Kenapa ditambah 1 ??? karena pas dikirim balik, ga ada segment yang perlu di acknowledged. Acknowledgement sepeti ini memungkinkan client untuk mengikat respon balik yang berasal dari original segment yang dikirim ke server…“iya…kenapa..gw merespon ni…mo ngapain ente ??”
  3. Client yang meng-inisialisasi merespond dengan acknowledgement value yang setara dengan sequence value yang di terima dari server ditambah 1. Selesai deh process meng-establish connection

To understand the three-way handshake process, it is important to look at the various values that the two hosts exchange. Within the TCP segment header, there are six 1-bit fields that contain control information used to manage the TCP processes. Those fields are:

  • URG – Urgent pointer field significant
  • ACK – Acknowledgement field significant
  • PSH – Push function
  • RST – Reset the connection
  • SYN – Synchronize sequence numbers
  • FIN – No more data from sender

Field2 bit ini lah yang disebut FLAGS… the value of one of these fields is only 1 bit and, therefore, has only two values: 1 or 0. When a bit value is set to 1, it indicates what control information is contained in the segment.

Gambar diatas adalah process terminasi session.

Untuk lebih jelas tentang three way handshake….

pakailah wireshark J

————————————————————————————————————————————————————————————

The initial window size is determined during the session startup via the three-way handshake.

Taken from Tcpipguide.com, What is Window Size…In a connection between a client and a server, the client tells the server the number of bytes it is willing to receive at one time from the server; this is the client’s receive window, which becomes the server’s send window. Likewise, the server tells the client how many bytes of data it is willing to take from the client at one time; this is the server’s receive window and the client’s send window.


—————————————————————————————————————————————————————————

UDP…User Datagram Protocol

Seperti yang sudah dijelaskan yang sudah2…UDP tidak menyediakan fungsi reliability, *jadi ga penting donk pake ini??

Well, TCP memakan banyak overhead….klo orang awam bilang…terlalu banyak makan bandwidth…kita perlu yang simple2 aja…contoh nya :

  • Domain Name System (DNS)
  • Simple Network Management Protocol (SNMP)
  • Dynamic Host Configuration Protocol (DHCP)
  • Routing Information Protocol (RIP)
  • Trivial File Transfer Protocol (TFTP)
  • Online games…yes..ONLINE GAME…klo pake TCP…rasain aja sendiri LAG nya (ga pake TCP aja kadang suka lag hahaha)

Oke ?? sudah mengerti ?? untuk2 contoh2 aplikasi diatas…memakai UDP sangat efisien dan juga efektif (aplikasi2 tersebut ga butuh acknowledgement dalam transfer data…GA PENTING katanya J )

Note : Trivia…istilah segment kadang2 bisa di artikan sebagai datagram juga loh dalam UDP

*wokeh..selesai untuk Transport layer

Next…Network Layer…its gonnna be a looong day (baca: long read…hahaha)

Older Entries