 video session on data link layer framing methods. Myself, Professor Vipul Kondekar from Walton Institute of Technology, Solapur. These are the learning outcomes of this video session. So student will be able to identify why we need framing at data link layer as well describe operation of different framing techniques. In this video session, these are the contents we will have introduction and we will go through the need of framing and then different framing methods. We will try to understand different framing methods. Now what do we by frame? Frame is basically a data link layer entity. At data link layer, framing is done. Framing is nothing but dividing the data into manageable data units. Manageable in the sense we know that if you are sending the data that data goes from data link layer to the physical layer. Now what we want is we want to divide the data in such a way that physical layer could manage that data transfer entity. So we call that manageable data unit as frame. Now let us go for understanding different framing methods. So first framing method is character count framing method. Now what happens in the character count is if we assume that what data you are sending is having fixed number of character size. Fixed bit length is there for every character. In that case if you are sending let us say ASCII character how I do the framing is start of every frame will be a character count. Let us say I start the frame with character count as 5. It indicates that the first frame has 5 different characters including this character count. So let us say after this 5 what comes is 4, 3, 2, 1. Let us say again it is 3, 2, 4, 4, 1, 2, 3. These are the characters saying by the technique character count framing method. So how exactly frames are considered. So first will be the character count and it indicates that in the first frame there are 5 different characters including this. So 1, 2, 3, 4, 5. So this will be a frame number 1. This will be considered as frame number 1. Now next character count is 3. So next frame has 3 characters. So this will be frame number 2 and this will be frame number 3. But this is the simplest technique of forming the frames. But the problem with this framing technique is assume that the frame count itself gets garbled. Let us say 5, its binary representation will be 0, 1, 0, 1. Let us say one single bit error occurs in the character count itself and then instead of this 1 your character count is becoming 0, 1. Let us say 0, 0. What it indicates the character count is 4 and in that case at the receiver side what will be the interpretation made if this bit has garbled, 1 bit in the character count has garbled. So it will consider that there are 4 bits, 4 characters in the frame. So this will be considered as frame number 1. Then 1 character in frame 2. So this will be considered as frame number 2. 3 characters so like this. So the synchronization is totally lost if the character count itself gets garbled. This is the drawback of the technique called character count for the framing. Second method of framing is flag bite with bite stuffing framing method. Now the drawback of character count is character count gets garbled. We cannot achieve the synchronization at the receiver side. So to remove this drawback what we do is we use a flag bite at the start as well as flag bite at the end. And then there may be some header information, tailor information and then actual payload field. So this is how a frame will be formed if you are using this technique. Now flag bite will be some bit combination that may be if a 1 byte flag is there that may be some bit combination let us say bit combination is 1111 1111. Now we know that the payload field can take any value especially when you are doing the transmission of the floating point data it is highly possible that the flag characters are flag bit combinations are appearing in the payload field itself. Now if it is appearing in the payload field so if the receiver makes its interpretation as the flag bit itself again there will be problem in the receiving frames correctly. So what is done to remove that drawback of appearance of the flag character in the payload field what is done at the transmitter side is transmitter makes the use of some escape character. Now what transmitter does is when it is transmitting the data when it is for checking the payload field if it finds that escape character itself is there in the payload field what actually gets sent is escape characters for two times or if flag bite is appearing in the payload field what actually gets sent is before that flag bite one escape character is sent. Let us take some examples that when you are transmitting the data by this technique how these escape characters are stopped. If you are having data where A and B are the data characters and data itself is having flag value. So what actually gets sent is you will be sending A then escape character then flag and B. If the data itself has escape character what you will be sending A then escape character again escape character and B. If data has this combination escape flag so what you will be sending is A then escape escape and then one escape character again flag and B. On the same lines if the data has A escape escape combination this combination is there actually what gets sent is A escape character again escape character to nullify this effect and then again escape character escape character and B. So this is how the stuffing is done of the escape character in the payload field so that receiver should not have any confusion that actually payload field is a flag bite or not or it is escape bite or not. So this is the second method of framing called as flag bite with byte stuffing byte stuffing you are making of escape characters because you know that the flag bite itself may appear in the payload field itself. Now we will go for third method of framing that is starting and ending flag with bit stuffing. What is the need of this method is if you go for flag bite or character count we assume that the payload field which you are sending is having fixed data width all the characters all the data has fixed length. But if the data itself has got variable length then previous two methods cannot be used there. So what we do here is you will be having some starting or ending flag that flag combination may be same for example you may have starting flag as let us say 0 1 2 3 4 5 6 0. So this is the combination I am using as starting or let us say same is used as the ending flag. So how you will do the framing start of frame will be this character combination as well as end of frame will be also by this same character combination. Now again we know that it is highly possible that when you are sending your data data may take these values of starting flag or ending flag in that case what we need to do what we need to do in that case is we will go for bit stuffing means when you are sending the data let us say you are sending the data which has got these 6 number of 0 this is the part of data itself. Again you are sending this combination 0 this is the data itself. Now this should not be interpreted as starting or ending flag. So what is done at the transmitter side is at the transmitter side what is done is stuffing is done stuffing of what bit. So what transmitter does is transmitter make sure that neighbor 6 consecutive ones will appear in your data. So if it finds that they are appearing so what it will do is it will find that 0, 1, 1, 1, 1, 1 next is 1 so 6 consecutive ones are appearing. So what is done is this 0 is stuffed and then this will be 1, 0. Again next will be 0, 1, 1, 1, 1, 1, 5 ones are there. So what gets what is done is again this 0 is stuffed and then this is 1, 0. So this is what we can say stuffing this is what we can say stuffed data and now what is done at the receiver side is whenever it finds D stuffing is done D stuffing is done at the receiver side. So what receiver does is after 5 consecutive ones whatever 0 is received so that 0 is neglected. So ultimately what receiver will receive is this 0, 1, 1, 1, 1, 5 ones are there after that 0 is there so that gets neglected and after D stuffing again what you are going to get is the same data. So this is how the problem is solved of appearance of your starting or ending flag in the data itself. Otherwise whatever is your data whatever may be the size of the data if it may be varying also so that can be used to form a frame by using this particular technique called as starting and ending flag with bit stuff. And now the last method for framing is physical layer coding violations. Now what this method is when you want to form the frame usually you are sending the data and data when you are sending. So if you are sending single bit data one simple way of sending the data is if you are sending 1 so what you do is you transfer 1 for that particular high voltage for that bit duration or if you are sending data as 0 what you do is you transfer 0 volt for that particular duration. But what is done is data encoding is done so there can be one way of coding the data called as Manchester coding. In data formats you might have studied these are the different coding techniques. In Manchester coding what is done is if you want to transfer 1 then actually for half so this is the bit duration let us say so for half bit duration high voltage is sent and for remaining half bit duration 0 volt is sent. On the same line if you want to transmit data 0 so for half bit duration 0 is sent and for remaining half bit duration 1 is sent. So this is called as Manchester coding. But what we can do is we can have violation of these coding techniques. So here though you are sending 1 what actually gets sent is 1 0 though you are sending 0 what actually gets sent is 0 1. So what we do is to have this framing we will violate this coding where the start of the frame may be indicated by 1 appearing for whole bit interval. So that will be considered as 1 1 or that may be 0 0. So if you are using Manchester coding and then in a bit interval you are finding 1 1 or 0 0 it indicates that this is the start or end of the frame. So at the end can you find out which frame format which framing technique is used for Ethernet. What is the frame format for that as well what is the maximum possible size of the frame for the Ethernet. Remember practically if you framing is done by making the use of one of these framing techniques along with the technique character count to make to have extra safety in the transmission of the frames. These are the references used for this presentation. Thank you.