Data link layer

The data link layer, or layer 2, is the second layer of the seven-layer OSI model of computer networking. This layer is the protocol layer that transfers data between nodes on a network segment across the physical layer.[2] The data link layer provides the functional and procedural means to transfer data between network entities and may also provide the means to detect and possibly correct errors that can occur in the physical layer.

The data link layer is concerned with local delivery of frames between nodes on the same level of the network. Data-link frames, as these protocol data units are called, do not cross the boundaries of a local area network. Inter-network routing and global addressing are higher-layer functions, allowing data-link protocols to focus on local delivery, addressing, and media arbitration. In this way, the data link layer is analogous to a neighborhood traffic cop; it endeavors to arbitrate between parties contending for access to a medium, without concern for their ultimate destination. When devices attempt to use a medium simultaneously, frame collisions occur. Data-link protocols specify how devices detect and recover from such collisions, and may provide mechanisms to reduce or prevent them.

Examples of data link protocols are Ethernet, the IEEE 802.11 WiFi protocols, ATM and Frame Relay. In the Internet Protocol Suite (TCP/IP), the data link layer functionality is contained within the link layer, the lowest layer of the descriptive model, which is assumed to be independent of physical infrastructure.

Function

The data link provides for the transfer of data frames between hosts connected to the physical link. Within the semantics of the OSI network architecture, the protocols of the data link layer respond to service requests from the network layer, and perform their function by issuing service requests to the physical layer. That transfer can be reliable or unreliable; many data link protocols do not have acknowledgments of successful frame reception and acceptance, and some data link protocols might not even perform any check for transmission errors. In those cases, higher-level protocols must provide flow control, error checking, acknowledgments, and retransmission.

The frame header contains the source and destination addresses that indicate which device originated the frame and which device is expected to receive and process it. In contrast to the hierarchical and routable addresses of the network layer, layer 2 addresses are flat, meaning that no part of the address can be used to identify the logical or physical group to which the address belongs.

In some networks, such as IEEE 802 local area networks, the data link layer is described in more detail with media access control (MAC) and logical link control (LLC) sublayers; this means that the IEEE 802.2 LLC protocol can be used with all of the IEEE 802 MAC layers, such as Ethernet, Token Ring, IEEE 802.11, etc., as well as with some non-802 MAC layers such as FDDI. Other data-link-layer protocols, such as HDLC, are specified to include both sublayers, although some other protocols, such as Cisco HDLC, use HDLC's low-level framing as a MAC layer in combination with a different LLC layer. In the ITU-T G.hn standard, which provides a way to create a high-speed (up to 1 Gigabit/s) local area network using existing home wiring (power lines, phone lines and coaxial cables), the data link layer is divided into three sub-layers (application protocol convergence, logical link control and media access control).

Sublayers

The data link layer is often divided into two sublayers: logical link control (LLC) and media access control (MAC).[3]

The uppermost sublayer, LLC, multiplexes protocols running at the top of the data link layer, and optionally provides flow control, acknowledgment, and error notification. The LLC provides addressing and control of the data link. It specifies which mechanisms are to be used for addressing stations over the transmission medium and for controlling the data exchanged between the originator and recipient machines.

Media access control sublayer

MAC may refer to the sublayer that determines who is allowed to access the media at any one time (e.g. CSMA/CD). Other times it refers to a frame structure delivered based on MAC addresses inside.

There are generally two forms of media access control: distributed and centralized.[4] Both of these may be compared to communication between people. In a network made up of people speaking, i.e. a conversation, they will each pause a random amount of time and then attempt to speak again, effectively establishing a long and elaborate game of saying "no, you first".

The Media Access Control sublayer also performs frame synchronization, which determines the start and end of each frame of data in the transmission bitstream. It entails one of several methods: timing-based detection, character counting, byte stuffing, and bit stuffing.

  • The time-based approach expects a specified amount of time between frames.
  • Character counting tracks the count of remaining characters in the frame header. This method, however, is easily disturbed if this field is corrupted.
  • Byte stuffing precedes the frame with a special byte sequence such as DLE STX and succeeds it with DLE ETX. Appearances of DLE (byte value 0x10) have to be escaped with another DLE. The start and stop marks are detected at the receiver and removed as well as the inserted DLE characters.
  • Similarly, bit stuffing replaces these start and end marks with flags consisting of a special bit pattern (e.g. a 0, six 1 bits and a 0). Occurrences of this bit pattern in the data to be transmitted are avoided by inserting a bit. To use the example where the flag is 01111110, a 0 is inserted after 5 consecutive 1's in the data stream. The flags and the inserted 0's are removed at the receiving end. This makes for arbitrary long frames and easy synchronization for the recipient. The stuffed bit is added even if the following data bit is 0, which could not be mistaken for a sync sequence, so that the receiver can unambiguously distinguish stuffed bits from normal bits.

Services

The services provided by the data link layer are:

Error detection and correction

In addition to framing, the data link layer may also detect and recover from transmission errors. For a receiver to detect transmission errors, the sender must add redundant information as an error detection code to the frame sent. When the receiver obtains a frame it verifies whether the received error detection code matches a recomputed error detection code.

An error detection code can be defined as a function that computes the r (amount of redundant bits) corresponding to each string of N total number of bits. The simplest error detection code is the parity bit, which allows a receiver to detect transmission errors that have affected a single bit among the transmitted N + r bits. If there are multiple flipped bits then the checking method might not be able to detect this on the receiver side. More advanced methods than parity error detection do exist providing higher grades of quality and features.

H E L L O
8 5 12 12 15

A simple example of how this works using metadata is transmitting the word "HELLO", by encoding each letter as its position in the alphabet. Thus, the letter A is coded as 1, B as 2, and so on as shown in the table on the right. Adding up the resulting numbers yields 8 + 5 + 12 + 12 + 15 = 52, and 5 + 2 = 7 calculates the metadata. Finally, the "8 5 12 12 15 7" numbers sequence is transmitted, which the receiver will see on its end if there are no transmission errors. The receiver knows that the last number received is the error-detecting metadata and that all data before is the message, so the receiver can recalculate the above math and if the metadata matches it can be concluded that the data has been received error-free. Though, if the receiver sees something like a "7 5 12 12 15 7" sequence (first element altered by some error), it can run the check by calculating 7 + 5 + 12 + 12 + 15 = 51 and 5 + 1 = 6, and discard the received data as defective since 6 does not equal 7.

More sophisticated error detection and correction algorithms are designed to reduce the risk that multiple transmission errors in the data would cancel each other out and go undetected. An algorithm that can even detect if the correct bytes are received but out of order is the cyclic redundancy check or CRC. This algorithm is often used in the data link layer.

Protocol examples

Relation to the TCP/IP model

In the Internet Protocol Suite (TCP/IP), OSI's data link layer functionality is contained within its lowest layer, the link layer. The TCP/IP link layer has the operating scope of the link a host is connected to, and only concerns itself with hardware issues to the point of obtaining hardware (MAC) addresses for locating hosts on the link and transmitting data frames onto the link. The link-layer functionality was described in RFC 1122 and is defined differently than the data link layer of OSI, and encompasses all methods that affect the local link.

The TCP/IP model is not a top-down comprehensive design reference for networks. It was formulated for the purpose of illustrating the logical groups and scopes of functions needed in the design of the suite of internetworking protocols of TCP/IP, as needed for the operation of the Internet. In general, direct or strict comparisons of the OSI and TCP/IP models should be avoided, because the layering in TCP/IP is not a principal design criterion and in general, considered to be "harmful" (RFC 3439). In particular, TCP/IP does not dictate a strict hierarchical sequence of encapsulation requirements, as is attributed to OSI protocols.

See also

References

  1. ^ "X.225 : Information technology – Open Systems Interconnection – Connection-oriented Session protocol: Protocol specification". Archived from the original on February 1, 2021. Retrieved March 10, 2023.
  2. ^ "What is layer 2, and Why Should You Care?". accel-networks.com. Archived from the original on February 18, 2010. Retrieved September 29, 2009.
  3. ^ Regis J. Bates and Donald W. Gregory (2007). Voice & data communications handbook (5th ed.). McGraw-Hill Professional. p. 45. ISBN 978-0-07-226335-0.
  4. ^ Guowang Miao; Guocong Song (2014). Energy and spectrum efficient wireless network design. Cambridge University Press. ISBN 978-1107039889.

Read other articles:

Office skyscraper in Manhattan, New York Tower 49Tower 49 - Looking southwesterly from Madison Avenue & 49th StreetGeneral informationStatusCompletedTypeOfficeArchitectural styleModernAddress8-18 East 49th StreetTown or cityMidtown Manhattan, New York CityCountryUnited StatesCoordinates40°45′26″N 73°58′37″W / 40.75722°N 73.97694°W / 40.75722; -73.97694Completed1985Height614 feet (187 m)Technical detailsFloor count45Design and constructionArchitect(...

Реформа церковного календаря в Україні Різдвяна листівка Якова ГніздовськогоУчасники 1. Греко-католицькі церкви2. Православна церква України3. ПротестантизмРезультат Впровадження григоріанського календаря: УЦХВЄ (липень 2022) ВСЦ ЄХБ (грудень 2022) Українська греко-католи�...

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (يناير 2017) هذه قائمة بالدول حسب عدد اللغات الرسمية المعترف بها. تتضمن القائمة الدول التي تعترف بثلاث لغات أو أكثر، سواء كانت على المستوى الوطني أو المحلي. البلد المستوى...

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article's lead section may be too short to adequately summarize the key points. Please consider expanding the lead to provide an accessible overview of all important aspects of the article. (December 2020) This article consists almost entirely of a plot summary. Please help improve the article by adding more real-world context. (Decembe...

Manjakani Quercus infectoria Status konservasiRisiko rendahIUCN194176 TaksonomiDivisiTracheophytaSubdivisiSpermatophytesKladAngiospermaeKladmesangiospermsKladeudicotsKladcore eudicotsKladSuperrosidaeKladrosidsKladfabidsOrdoFagalesFamiliFagaceaeGenusQuercusSpesiesQuercus infectoria Oliv., 1801 Tata namaSinonim takson Quercus carpinea Kotschy ex A.DC. Quercus grosseserrata Kotschy ex Wenz. Quercus puberula O.Schwarz Quercus thirkeana K.Koch[1][2] lbs Majakane, majakan, jenitri a...

Pengunjung museum sedang menyusun jembatan Leonardo da Vinci. Mathematikum adalah museum bertemakan ilmu matematika yang terletak di kota Gießen, Jerman. Ide mendirikan Mathematikum berawal pada tahun 1994 saat Albrecht Beutelspacher mengadakan pameran alat peraga matematika karya anak didiknya di Universitas Justus Liebig Giessen. Pameran yang dilakukan Albrecht Beutelspacher bersama mahasiswa ini dilakukan setiap tahun dan semakin menarik banyak pengunjung yang datang. Mulai tahun 1998 Alb...

Danish actress (1873–1943) Betty NansenBetty NansenBornBetty Anna Maria Müller(1873-03-19)19 March 1873Died15 March 1943(1943-03-15) (aged 69)Occupation(s)Actress, theatre directorSpouse(s)Peter NansenHenrik Bentzon Betty Nansen (née Betty Anna Maria Müller[1]) (19 March 1873 – 15 March 1943[2]) was a Danish actress and theatre director of the theater that carries her name, the Betty Nansen Theatre. Biography She was born on 19 March 1873. She had her debut in the ...

USL–1 redirects here. For the league that began play in 2019, see USL League One. Former soccer league Football leagueUSL First DivisionFounded2005Folded2010CountryUnited StatesOther club(s) fromCanada, Puerto RicoConfederationCONCACAFNumber of teams11–12Level on pyramid2Promotion toNoneRelegation toNoneDomestic cup(s)U.S. Open Cup, Canadian ChampionshipInternational cup(s)CFU Club ChampionshipLast championsPuerto Rico Islanders (2010)Most championshipsSeattle SoundersVancouver Whitecaps(...

Private university in Atlanta, Georgia Emory UniversityFormer nameEmory College (1836–1915)MottoCor prudentis possidebit scientiam (Latin)Motto in EnglishThe wise heart seeks knowledge[1]TypePrivate research universityEstablished1836; 187 years ago (1836)[2]AccreditationSACSReligious affiliationUnited Methodist Church[3][4]Academic affiliationsAAU[5]COFHEGRAIAMSCU[6]NAICU[7]ORAU[8]Endowment$11 billion (20...

Sporting CPNama lengkapSporting Clube de PortugalBerdiri1985StadionPavilhão João Rocha, Lisboa, Portugal(Kapasitas: 3,000)KetuaFrederico VarandasManajerNuno DiasLigaLiga Futsal Portugis2017–181 Kostum kandang Kostum tandang Sporting Clube de Portugal adalah tim futsal Portugis. Itu adalah bagian dari klub Sporting CP dan mereka adalah juara Eropa saat ini. Skuat No. Nat. Pemain Pos. 1 Gonçalo Portugal Penjaga gawang 2 Léo Cierre 3 Taynan Cierre/Ala 6 Pauleta Ala 7 Cardinal Pivot 8 Erick...

Japanese anime television series Love FlopsKey visual恋愛フロップス(Ren'ai Furoppusu)GenreHarem[1]Romantic comedy[2]Science fiction[3]Created byLove Flops Project MangaWritten byLove Flops ProjectIllustrated byRyūdai IshizakaPublished byHakusenshaMagazineYoung AnimalDemographicSeinenOriginal runJune 24, 2022 – July 28, 2023Volumes3 Anime television seriesDirected byNobuyoshi NagayamaProduced byShō TanakaTomoyuki OowadaJōtarō I...

Animated series created by William Joyce This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Rolie Polie Olie – news · newspapers · books · scholar · JSTOR (August 2021) (Learn how and when to remove this template message) Rolie Polie OlieAlso known asWilliam Joyce's Rolie Polie OlieGenreComic science fictionSci...

Mesoscale convective system shaped like a archer's bow Radar image of a bow echo crossing Kansas City at 2:14 AM on 2 May 2008 (NWS Kansas City) A bow echo is the characteristic radar return from a mesoscale convective system that is shaped like an archer's bow. These systems can produce severe straight-line winds and occasionally tornadoes, causing major damage. They can also become derechos or form Line echo wave pattern (LEWP). Research The term bow echo was first used by Theodore Fujita i...

Species of snake Arabian cobra Conservation status Least Concern (IUCN 3.1)[1] Scientific classification Domain: Eukaryota Kingdom: Animalia Phylum: Chordata Class: Reptilia Order: Squamata Suborder: Serpentes Family: Elapidae Genus: Naja Subgenus: Uraeus Species: N. arabica Binomial name Naja arabica(Scortecci, 1932) Range of Arabian cobra Synonyms[2] Naja haje arabicaScortecci, 1932 Naja (Uraeus) arabica — Wallach et al., 2009 Naja arabica — Trape et al., 2009 ...

Rangabzeichen eines Feldmarschallleutnants der k.u.k. Armee Feldmarschallleutnant, früher gelegentlich Feldmarschall-Leutnant geschrieben, abgekürzt FML (historisch auch Feldmarschall-Lieutenant, in Verlautbarungen der k.u.k. Militäradministratur ab 1867 von Amts wegen stets Feldmarschalleutnant) war ein militärischer Dienstgrad. Er kam gleichzeitig mit dem des Feldmarschalls im 17. Jahrhundert auf. Der Kriegsherr pflegte einem Feldmarschall einen „Untermarschall“ oder „Lieutenant�...

2010 compilation album by Swedish House MafiaUntil OneCompilation album by Swedish House MafiaReleased25 October 2010Recorded2009–2010Genre Electro house progressive house house Length79:26Label Virgin EMI Astralwerks ProducerAxwellSteve AngelloSebastian IngrossoSander van DoornThe SourceLaidback LukeAn21TV RockJusticeProk & FitchDaddy's GrooveEmpire of the SunDonnie SloanPeter MayesBenny BenassiHal RitsonDirty SouthKen NelsonColdplayDavid GuettaFred RisterMax VangeliLouie VegaJ...

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Villa Louvigny – news · newspapers · books · scholar · JSTOR (May 2020) (Learn how and when to remove this template message) You can help expand this article with text translated from the corresponding article in Luxembourgish. (October 2013) Click [show] ...

Willem Elsschot Født7. mai 1882[1][2][3][4]AntwerpenDød31. mai 1960[3][4][5][6] (78 år)AntwerpenBeskjeftigelseLyriker, skribentBarnIda De RidderNasjonalitetBelgiaGravlagtAntwerpenSchoonselhofMorsmålNederlandskSpråkNederlandsk[7]UtmerkelserConstantijn Huygens-prisen (1951)IMDbIMDbWillem Elsschot på Commons Willem Elsschot, pseudonym for Alphonsus Josephus de Ridder (født 7. mai 1882 i Antwerpen, død 31. mai 1960 i ...

Paghimo ni bot Lsjbot. Alang sa ubang mga dapit sa mao gihapon nga ngalan, tan-awa ang Holland Creek. 30°26′08″N 96°05′08″W / 30.43548°N 96.08551°W / 30.43548; -96.08551 Holland Creek Suba Nasod  Tinipong Bansa Estado Texas Kondado Grimes County Gitas-on 52 m (171 ft) Tiganos 30°26′08″N 96°05′08″W / 30.43548°N 96.08551°W / 30.43548; -96.08551 Timezone CST (UTC-6)  - summer (DST) CDT (UTC-5) GeoNames...

Paghimo ni bot Lsjbot. 50°13′30″N 60°45′07″W / 50.22513°N 60.75203°W / 50.22513; -60.75203 Havre Mackenzie Luuk Nasod  Kanada Lalawigan Québec Tiganos 50°13′30″N 60°45′07″W / 50.22513°N 60.75203°W / 50.22513; -60.75203 Timezone AST (UTC-4) GeoNames 5972278 Luuk ang Havre Mackenzie sa Kanada.[1] Nahimutang ni sa lalawigan sa Québec, sa sidlakang bahin sa nasod, 1,200 km sa sidlakan sa Ottawa ang ulohan s...