clear; clc; disp("--------------Example 2.1---------------") // example explanation printf("A node with physical address 10 sends a frame to a node with physical address 87. The two nodes are connected by a link (bus topology LAN).\nAt the data link layer, this frame contains physical (link) addresses in the header.The trailer contains extra bits needed for error detection.\nThe computer with physical address 10 is the sender, and the computer with physical address 87 is the receiver.\nThe header, among other pieces of information, carries the receiver and the sender physical (link) The destination address, 87 comes \nbefore the source address 10. In a bus topology, the frame is propagated in both directions (left and right). The frame propagated\nto the left dies when it reaches the end of the cable if the cable end is terminated appropriately. The frame propagated to the right is sent\nto every station on the network. Each station with a physical addresses other than 87 drops the frame because the destination address in the frame\ndoes not match its own physical address. The intended destination computer, however, finds a match between the destination address\nin the frame and its own physical address. The frame is checked, the header and trailer are dropped, and the data part is decapsulated and\ndelivered to the upper layer."); sender_address="10"; reciever_address="87"; clf(); xname("--------------Example 2.1----------------"); // display the figure xset("thickness",2.5); xpoly([.049 .86],[.48 .48]); xpoly ([.35 .35],[.73 .48]); xpoly ([.55 .55],[.73 .48]); xset("thickness",1); xset("font size",2); xstring(.36,.6,"Destination address does not"); xstring(.36,.56,"match;the packet is dropped"); xstring(.25,.63,"Trailer"); xstring(.001,.63,"Destination address"); xstring(.001,.5,"Source address"); xpoly([.1 .11],[.52 .55]); xpoly([.22 .25],[.6 .63]); xpoly([.05 .08],[.63 .6]); xset("font size",4); xstring(0.1,.75,["10 - Sender"]); xstring(0.7,.75,["87 - Reciever"]); xstring(.32,.75,"Station 28"); xstring(.52, .75,"Station 53"); xstring(.44,.42,"LAN"); xrect(.13,.7,.07,.05); xstringb(.13,.65,["Data"],.07,.05); xrect(.73,.7,.07,.05); xstringb(.73,.65,["Data"],.07,.05); xrects([ 0.07 .13 .2;.6 .6 .6;.06 .07 .03;.06 .06 .06]); xstring(0.07,.55,["87"]); xstring(0.1,.55,["10"]); xstring(0.2,.55,"T2"); xrect(.135,.595,.06,.05); xstring(.137,.555,["Data"]); xstring(0.67,.55,["87"]); xstring(0.7,.55,["10"]); xstring(.8,.55,"T2"); xrect(.735,.595,.06,.05); xstring(.737,.555,["Data"]); xset("font size",6); xstring(.43,.51,". . ."); xfrect(.009,.5,.04,.05); xfrect(.86,.5,.04,.05); xpoly([.17 .17],[.75 .7]); xpoly([.77 .77],[.75 .7]); xpoly([.17 .17],[.65 .6]); xpoly([.77 .77],[.65 .6]); xpoly([.17 .17],[.54 .48]); xpoly([.77 .77],[.54 .48]); xarrows([.74 .8],[.45 .45],.5); xarrows([.76 .76],[.45 .54],.5); xarrows([.34 .4],[.45 .45],.5); xarrows([.36 .36],[.45 .57],.5); xarrows([.54 .6],[.45 .45],.5); xarrows([.56 .56],[.45 .57],.5); xarrows([.14 .2],[.45 .45],.5); xarrows([.14 .08],[.45 .45],.5); xpoly([.16 .16],[.45 .54]); xset("line style",2); xrects([.67 .73 .8;.6 .6 .6;.06 .07 .03;.06 .06 .06]);