Showing posts with label Texas College. Show all posts
Showing posts with label Texas College. Show all posts
Access Control List (ACL): Differences between Standard ACL and Extended ACL
- It is a Layer 3 security which controls the flow of traffic from one router to another.
- It is also called as Packet Filtering Firewall.
Types of ACL
- Standard ACL
- Extended ACL
- Named ACL
Standard Access List
- The access-list number lies between 1 - 99.
- Can block a Network, Host and Subnet.
- Two-way communication is stopped.
- All services are blocked.
- Implemented closest to the destination.
Extended Access List
- The access-list number lies between 100 - 199.
- Can block a Network, Host, Subnet and Service.
- One-way communication is stopped.
- Selected services can be blocked.
- Implemented closest to the source.
C Program for Least Square Method (Regression Analysis)
#include<stdio.h>
#include<conio.h>
void main()
{
float x[100],y[100],sumx=0,sumx2=0,sumy=0,sumyx=0,b,a;
int i,n;
printf("Enter n: ");
scanf("%d",&n);
printf("Enter the values:\n");
for(i=0;i<n;i++)
{
printf("Enter x[%d] and y[%d]: ",i,i);
scanf("%f%f",&x[i],&y[i]);
}
for(i=0;i<n;i++)
{
sumx=sumx+x[i];
sumx2=sumx2+x[i]*x[i];
sumy=sumy+y[i];
sumyx=sumyx+y[i]*x[i];
}
//for y=ax+b
b=(sumx2*sumy-sumyx*sumx)/(n*sumx2-sumx*sumx);
a=(n*sumyx-sumx*sumy)/(n*sumx2-sumx*sumx);
printf("\nHence, the required eqn is y = %fx + %f",a,b);
getch();
}
OUTPUT:
8086 ALP: Display STRING in the CENTRE of the screen
PRNT MACRO MSG
MOV AH,09h
LEA DX,MSG
INT 21H
ENDM
DATA SEGMENT
MSG1 DB "ABC PQR XYZ$"
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
MOV AX,0600H
MOV BH,71H
MOV CX,0000H ;UPPER LEFT ROW,COLUMN
MOV DX,0184H ;LOWER RIGHT ROW,COLUMN
INT 10H
MOV AH,02H
MOV BH,00H
MOV DH,0CH
MOV DL,23H
INT 10H
PRNT MSG1
MOV AH,4CH
INT 21H
CODE ENDS
END START
OUTPUT:
8085 ALP: ASCENDING ORDER in a block of DATA
- Suppose, there is an array of ten 8-bit data stored in memory addresses from 2030h to 2039h.
- Starting from 2030h, we compare the data of the first location with that of the second location.
- If the data of the first location is greater than that of the second location, they are swapped.
- Running external loop for 9 times, 8 times, 7 times and so on, we run every internal loop as 9 times, 8 times, 7 times and so on for every corresponding external loop. For e.g. for external loop 9, we run respective internal loop 9 times.
- Doing so, after every external loop, the largest number will be at the last memory location.
MVI C, 09h
AGAIN: MOV D, C
LXI H, 2030h
NEXT: MOV A, M
INX H
CMP M
JC SKIP
MOV B, M
MOV M, A
DCX H
MOV M, B
INX H
SKIP: DCR D
JNZ NEXT
DCR C
JNZ AGAIN
HLT
Program to Find the Largest Number in a block of DATA: 8085
- Suppose, there is an array or block of ten 8-bit data stored from memory address 2030h. And, we have to find out the greatest number among them.
- What we are going to do here is that we compare every two data from the first location. If the data of first location is greater than that of second location, the latter will be replaced by the former.
- In this way, for 10 data, we run this logic 9 times and finally, the maximum number will be at the last location i.e, 2039h.
LXI H, 2030h
MVI C, 09h
AGAIN: MOV A, M
INX H
CMP M
JC SKIP
MOV M, A
SKIP: DCR C
JNZ AGAIN
HLT
Output:
8085 ALP: Division of TWO 16-bit NUMBERS
;SUPPOSE, We are going to divide 2050h by 1630h.
LXI H,0000H
SPHL
;SP holds quotient.
LXI H,2050H
;HL holds the dividend.
LXI B,1630H
;BC holds the divisor.
AGAIN: MOV A,H
CMP D
JC LAST
JZ CHKNXT
JMP DIVIDE
CHKNXT: MOV A,L
CMP C
JNC DIVIDE
JMP LAST
;Up to this, we have compared dividend with divisor.
DIVIDE: INX SP
;Now, HL <- HL - BC = HL + ((complement of BC) + 1)
;HL <- HL + DE + 1
MOV A,B
CMA
MOV D,A
MOV A,C
CMA
MOV E,A
INX D
DAD HL
;Finally, HL holds the remainder.
JMP AGAIN
LAST: HLT
LXI H,0000H
SPHL
;SP holds quotient.
LXI H,2050H
;HL holds the dividend.
LXI B,1630H
;BC holds the divisor.
AGAIN: MOV A,H
CMP D
JC LAST
JZ CHKNXT
JMP DIVIDE
CHKNXT: MOV A,L
CMP C
JNC DIVIDE
JMP LAST
;Up to this, we have compared dividend with divisor.
DIVIDE: INX SP
;Now, HL <- HL - BC = HL + ((complement of BC) + 1)
;HL <- HL + DE + 1
MOV A,B
CMA
MOV D,A
MOV A,C
CMA
MOV E,A
INX D
DAD HL
;Finally, HL holds the remainder.
JMP AGAIN
LAST: HLT
Sliding Window Protocol
- In sliding window method, multiple frames are sent by sender at a time before needing an acknowledgment.
- Multiple frames sent by source are acknowledged by receiver using a single ACK frame.
Sliding Window
- Sliding window refers to an imaginary boxes that hold the frames on both sender and receiver side.
- It provides the upper limit on the number of frames that can be transmitted before requiring an acknowledgment.
- Frames may be acknowledged by receiver at any point even when window is not full on receiver side.
- Frames may be transmitted by source even when window is not yet full on sender side.
- The windows have a specific size in which the frames are numbered modulo- n, which means they are numbered from 0 to n-l. For e.g. if n = 8, the frames are numbered 0, 1,2,3,4,5,6, 7, 0, 1,2,3,4,5,6, 7, 0, 1, ....
- The size of window is n-1. For e.g. In this case it is 7. Therefore, a maximum of n-l frames may be sent before an acknowledgment.
- When the receiver sends an ACK, it includes the number of next frame it expects to receive. For example in order to acknowledge the group of frames ending in frame 4, the receiver sends an ACK containing the number 5. When sender sees an ACK with number 5, it comes to know that all the frames up to number 4 have been received.
