Introductio
ThenetworkinterfacelayerisnotactuallypartoftheInternetprotocolsuite,butitisamethodfordatapacketstobetransmittedfromthenetworklayerofonedevicetothenetworklayerofanotherdevice.Thisprocesscanbecontrolledinthesoftwaredriverofthenetworkcard,orinthefirmwareordedicatedchip.Thiswillcompletesomedatalinkfunctionssuchasaddingaheadertopreparefortransmission,andactuallytransmittingthroughthephysicalmedium.Attheotherend,thelinklayerwillcompletethedataframereception,removetheheaderandpassthereceivedpackettothenetworklayer.
However,thelinklayerisnotoftenthissimple.Itmayalsobeavirtualprivatenetwork(VPN)ortunnel,wherepacketsfromthenetworklayeraresentusingthetunnelprotocolandother(orthesame)protocolsuiteinsteadofbeingsenttothephysicalinterface.VPNsandtunnelsareusuallypre-built,andtheyhavesomespecialfeaturesthatarenotdirectlysenttothephysicalinterface(forexample,itcanencryptdatapassingthroughit).Sincethelink"layer"isnowacompletenetwork,therecursiveuseofthisprotocolsuitemaycauseconfusion.Butitisanexcellentwaytoimplementcommoncomplexfunctions.(Althoughyouneedtopayattentiontopreventapacketthathasbeenencapsulatedandsentthroughthetunneltobeencapsulatedandsentagain).
Relatedinformation
ThenetworkinterfacelayercorrespondstothephysicallayeranddatalinklayerintheOSIreferencemodel.ThenetworkinterfacelayeristheinterfacebetweenTCP/IPandvariousLANsorWANs.
Thenetworkinterfacelayerencapsulatestheupper-layerIPdatagramintoaframeatthesendingendandsendsittothenetwork;whenthedataframereachesthereceivingendthroughthenetwork,thenetworkinterfacelayerofthenodedecapsulatesthedataframe.AndchecktheMACaddresscontainedintheframe.IftheaddressistheMACaddressofthemachineorthebroadcastaddress,itwillbeuploadedtothenetworklayer,otherwisetheframewillbediscarded.
Whenaseriallineisusedtoconnectthehostandthenetwork,ortoconnectthenetworkandthenetwork,forexample,thehostconnectstotheInternetthroughamodemandtelephoneline,youneedtoruntheSLIPorPPPprotocolatthenetworkinterfacelayer.
☆SLIP(SerialLineInternetProtocol)protocolprovidesasimplewaytoencapsulateIPdatagramsonserialcommunicationlines,allowinguserstoeasilyaccessTCP/IPnetworksthroughtelephonelinesandmodems.
☆PPP(PointtoPointProtocol)isaneffectivepoint-to-pointcommunicationprotocolthatsolvestheabove-mentionedproblemsofSLIP,thatis,itcansupportmultiplenetworklayerprotocols(suchasIP,IPX,etc.),SupportsdynamicallyallocatedIPaddresses;andacheckfieldissetinthePPPframe,soPPPhaserrorcheckingcapabilitiesonthenetworkinterfacelayer.