Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BASIC CONCEPT OF PROXY
- Proxies can be understood as a third party who stands in the middle between the two parties that are interconnected and function as an intermediary, such that the first party and second party is not directly related, but are each associated with an intermediary, namely the Proxy.
- An analogy: if a student to borrow books at the library, sometimes the students are not allowed to directly search and retrieve their own books that we want from the shelves, but we request books to the officers, of course, by giving a number or code book, and then the officer who will find and fetch the book. In the case above, the librarian has been acting as an intermediary or proxy. Officers are also able to ensure and maintain, for example, that students can only borrow books for students, faculty may borrow books all the books, or the general public may only borrow a certain book.
- Perhaps the process has become much longer than if we directly search and retrieve their own books we want. But at a time when officers seek to get the book to someone, the officer also made several copies of the book before giving his book to people who ask, and keep it on the table service, so if there are other people who ask for a specific book, very likely The requested book has been available a copy of it on the table, and the clerk gave it to stay straight. The result is a faster service as well as good security.
- The above analogy to explain the concept and basic functions of a proxy in the communication network of computers and the Internet. Proxy server has three main functions, namely,
- Connection Sharing
- Filtering
- Caching
- Each function will be explained further below.
- Proxy in a sense as an intermediary, working in different types of network communication protocols and can be at different levels in the hierarchy of the network communication protocol layer. An intermediary can only work on the Data-Link layer, Network layer and Transport layer, Application layer and communication layer in the hierarchy according to the OSI network. But the notion is largely a proxy server to appoint a proxy server that works as an application layer, although it will also be discussed about the proxy at the circuit level.
- In a local network connected to another network or the Internet, users do not directly relate to the external network or the Internet, but must pass through a gateway, which acts as the boundary between the local network and outside networks. Gateway is very important, because the local network must be well protected from the dangers that may come from the internet, and it will be difficult Bial no clear boundary lines of local networks and the Internet. Gateway also acts as the point where the number of connections from local users will be connected to him, and a connection to the outside network is also connected to him. Thus, the connection of local networks to the Internet will use a connection that is owned by the gateway together (connection sharing). In this case, the gateway is also a proxy server, as it provides services as an intermediary between the local network and outside networks or the Internet.
- The following diagram illustrates the position and function of the proxy server, between users and service providers:
- PROXY, GATEWAY AND FIREWALL
- Proxy servers also typically be one with a firewall server, although both are working on different layers. Firewall or packet filtering that is used to protect local networks from attack or disruption that comes from working on the Internet network layer, while the proxy server works at the application layer. A firewall is usually placed on the routers, for so they can perform filtering of packets passing to and from the connected networks.
- Because firewalls perform filtering based on a list of rules and certain access arrangements, it is easier to regulate and control traffic from sources that are not trusted. Firewalls also do filtering based on the type of protocol used (TCP, UDP, ICMP) and TCP or UDP port used by a service (such as telnet or FTP). So that firewalls do with methods of control may be passed or not passed, in accordance with the listing rules and access arrangements are made. If a particular service or a specific address or addresses of reliable service, it can be set on the firewall so that packets from trusted sources are allowed to pass.
- Packet filtering in firewalls have the advantage of kecapatan more and does not require a specific configuration on the connected users. But on the other hand can cause difficulties, because it would be very difficult if we have to make a list of rules are many and complex. In addition, the firewall can be done simply to allow or not allow a packet through the IP addresses based on source or destination IP addresses that exist in the package. Attackers can forge the IP address of the packet (spoofing) uses a particular IP address is trusted, and the firewall will miss it. The attacker can also perform intercepts packets (sniffing) with relative ease to know the structure of IP addresses in packet headers passing on the network.
- In analogy to the above libraries, filtering on the firewall is similar to the librarian saves a list of students and lecturers are reliable, and they should immediately take their own desired book from the shelf. This could result in the circulation of books that are faster, but require special handling that allowed the top of the list. It is also at risk if there is someone who is using the false identities, so as if he was one of the list are allowed.
- Proxy server uses a different way. Proxy server bypass a direct connection between users and services diakases (or between students and library books in the analogy above). This was done first by changing the IP address, create a mapping from the local network IP address into an IP address of the proxy, which is used for external network or the Internet. Because only survived the proxy IP which will be known in general on the internet (untrusted network), then the forgery can not be done.
- OSI LAYER APPROACH
- Because working at the application layer proxy, the proxy server can run on many applications including HTTP Proxy or Web Proxy for HTTP protocol or the Web, FTP Proxy, SMTP Proxy / Proxy for POP mail, NNTP proxy for Newsgroups, RealAudio / RealVideo Proxy for streaming multimedia , IRC proxy for Internet Relay Chat (IRC), and others. Each will only receive, forwarding or filtering on packets generated by the corresponding service.
- Application specific proxy configurations have very much choice. For example, the Web Proxy can be configured to deny access to certain websites at certain times. Likewise, other proxies, for example, can be configured to only allow FTP download and does not allow FTP uploads, allow only certain users can play RealAudio files, preventing access to the email server before a certain date, and much more.
- Proxy servers are also very good in terms of ability to keep records (logging) for network traffic, and can be used to ensure that the connections for a particular type of traffic should always be available. For example, an office has a continuous connection to the Internet for Web access using a dial-up connection. Proxy servers can be configured to open one more connection Dial-up both when there are users who do download via FTP on a Dial-up first in a long time.
- As usual, the weakness of the configuration is very flexible and many options is the emergence of complexity. Application on the user side such as Web browsers or RealAudio Player should come configured to be aware of the proxy server and can use their services. When a new service is made on the internet that runs at the application layer, using the new protocol and the new port, it must be also a specific proxy and corresponding with the service. The process of adding users and defining the access rules in a proxy can also be very complicated.
- As an intermediary between users and servers on the Internet, the proxy server works by receiving a service request from the user, and then the proxy server instead will represent the user's request, to the servers on the Internet that are intended. Thus, the actual proxy server forwards the request only the user to the server in question, but here the identity of requesters has changed, no longer a home user, but the proxy server. The servers on the Internet will only be useful to keep the identity of the proxy server, as requested, but will not know the actual requesters (ie home users) because demand is down to the servers on the Internet is no longer the home user, but from the proxy server.
- For penggguna itself, a process that occurs on the proxy server also does not appear above (transparent). The user makes a request for services on the internet directly to the servers on the Internet service. Penguna only know the existence or the address of the proxy server, which is required to perform the configuration on sisis users to be able to use the services of a proxy server.
- Caching
- The basic functions of the third and very important from a proxy server is caching. Proxy servers have a mechanism for storing objects that have been requested from the servers on the Internet, commonly called caching. Therefore, the proxy server that also perform caching process is also commonly called cache servers.
- Caching mechanism to store objects that are the result of requests from users, which is available online. Because the proxy server acts as an intermediary, then the proxy server to get the objects in advance from the source to be forwarded to the requesting ekmudian true. In the process, the proxy server is also at the same store the objects for itself in available disk space (cache).
- Thus, a time when there are users who require a service to the internet that contain objects similar to those already been asked before, namely that already exist in the cache, then the proxy server will be able to immediately provide the requested object from the cache to the user, without having to reset to the original server on the internet. If the request can not be found in the cache on the proxy server, proxy server and then continue or memintakannya to the original server on the internet.
- Caching process is also not visible to the user (transparent), because the user does not seem exactly who is providing the requested object, whether a proxy server that take away from its cache or the original server on the internet. From the user side, all will appear as a reply directly from the internet.
- One of the proxies of the most widely discussed and widely used is an HTTP proxy or Web proxies. HTTP proxy is a proxy server that stands between the allocation of web users such as web browsers and web server or HTTP server.
- When users open a browser and type in the URL, the URL of the requested content is called â € œInternet Objectâ €?. First he would ask them first to a DNS (Domain Name Server). DNS will find the IP address of the URL in the database and give an answer to the browser again. After getting the IP browser, it will open a connection to the web server http port of destination. Web server will listen to the requests from the browser and then provide the requested content. Seteleh browsers accept content with the web server then the connection can be disconnected. Content then displayed and stored in the hard drive.
- Content is stored in disk cache object is usually called the natinya be used if the user re-visiting the same site, for example by clicking the back button or see the history. In a subsequent visit, the browser will check the stored content validation, validation is done by comparing the content headers that exist in the cache object to that of the web server, if the contents have not expired (expiry), the contents will be displayed before returning to the browser.
- Cache object that is stored in local hard drive is only bias used by the user alone, not bias shared with other users, another thing if the content is stored on a server, where all the computers connected to the server, then the cache object is shared bias , the server is exactly what will be called the cache server or proxy server.
- Cache server placed at the point between the client and web server. In the example above the client will request content from a web server to a cache server, not directly to the web server destination. The cache server is responsible for downloading the requested content and gave it to the client. Content was stored at hardsik local cache server. Other times, there are clients that request the same content, then the cache server does not need to be taken directly from the destination server, but just give the existing content. Therein lies the optimization of the cache server.
- There are two types of caching methods, namely passive and active. As we have seen, the object that is stored can be reached expired, to do the validation check. If the validation is done after a request from the client, this method is called passive. In active caching, the cache server and the pattern of observed object changes. Suppose that an object found in every day changes every 12 noon and users usually read it at 14, then the cache server without the client will update the requested object is between 12 and 14 noon, with automatic updates this way it takes the user to get a fresh object will be less.
- In certain circumstances, the storage capacity will be exhausted by the object. However, the cache server has several methods of removal to maintain the capacity to stay awake, in accordance with a predetermined kopnfigurasi. This deletion was based on the age and popularity, the older age of the object will be high priority for removal. And also for objects that are not popular will more quickly be removed as well.
- The following diagram illustrates the process and mechanism of caching:
- CACHE HIERARCHY
- Between the cache server can be established mutual cooperation. Protocol â € œkerja Samaa €?? is named the Internet Cache Protocol (ICP). With ICP, the cache system can have a hierarchy. The hierarchy is formed by two types of relationships, namely parent and sibling.
- Parent: cache servers are required to find content that is requested by the client
- Sibling: cache servers that are required to provide the requested content if it is available. If not, the sibling is not obliged to find him
- From two to do this, the system can be designed in multilevel cache. Suppose that in designing an ISP or campus network, you will have the bias is more than one cache server that each sibling to one another. Another scenario for example between the cache headquarters and branch offices, where the headquarters is located at the Internet gateway. Parent's headquarters in addition to its local network is used, is also burdened with traffic from the branch office's server cache.
- For a variety of cache designs can be seen from the scheme following image:
- In the picture above it is clear that among the sibling caches with each other to exchange objects, and if not there then it will ask for sibling cache content to cache servers and cache servers are obliged to give it, in real conditions of the cache sibling relationship is more than one bias.
- This type of dependency relationship is full, the child cache (cache server) will inevitably have to ask the parent, and parent was obliged to meet the demand child without exception, on the condition of presence or absence of the requested object in the hardsiknya. And for the child, if the parent does not meet the demand bias, then the child cache will give an error message on the browser client that the requested URLs and the content can not be retrieved.
- TRANSPARENT PROXY
- One of the complexity of application-level proxy is that on the user side to do the configuration that is specific to a particular proxy in order to use the services of a proxy server. If desired so that users do not have to do any special configuration, we can configure the proxy / cache server to run completely transparent to the user (transparent proxy). Usually this requires the help and configuration of firewall application (that works at the network layer) to be able to make a transparent proxy that works at the application layer.
- Transparent proxies can be useful for â € œmemaksa penggunaâ €?? use a proxy / cache server, as users really do not know about the existence of this proxy, and any configuration on the user side, as long as the proxy server is located on a network path that must be traversed by the user to go to the internet, then the user would by itself be â œmenggunakanâ € €?? proxy / cache it.
- How to create a transparent proxy is to deflect the direction (redirecting) of the packets for a particular application, using one or more rules on the firewall / router. This can be done because of any TCP-based applications will use one of the available ports, and firewalls can be set to divert packets headed to a particular service port, the direction of the corresponding port of the proxy.
- For example, when the client opens an HTTP connection (port 80) with a web server, the firewall on the router that receives immediately recognize that a data packet from the client with port number 80. Here we also have an HTTP proxy server running on port 3130. So on the firewall router's create a rule which states that every packet that comes from the local network to the port 80 must be deflected toward the HTTP address of the proxy server port 3130. As a result, all web requests from the user will enter and be represented by a proxy server over HTTP.
- So in general the advantages of the method itself is a transparent proxy:
- Ease of network administration, with the sense that clients use a browser that does not have to be configured specifically stating that they use proxies facilities are concerned.
- Centralized control, with the sense, the turn of the proxy bypass methods and the use of proxies by the client can be done centrally.
- [Edit] SQUID PROXY WEB / CACHE
- One example application proxy / cache server is Squid. Squid are known as application proxy and cache servers that are reliable. On the client side to work apliaksi browser requesting the http request on port 80. This browser will prompt the configured content, which is hereinafter referred to as object, the cache server, the port number that has been tailored to the server, a number that is used instead of port 80 but port 8080 3130 (mostly cache server uses that port as default).
- At the time browser sends a request header, http request signal sent to the server. Squid header was received and read. From the reading, parsing the squid will be required URL, the URL is matched anaesthetized with an existing database cache.
- This database is a collection of metadata (such header) of an existing object in the disk. If there is, the object will be sent to the client and recorded in the logging that the client has received the requested object. In the event log will be recorded as TCP_HIT. Conversely, if the requested object was not there, squid will seek it from peers or directly to the destination server. After getting objectnya, Squid will store the object into the hard drive. During the process of downloading this object is called â € œobject in transitâ €?? which will temporarily occupy memory space. In the downloaded earlier, the object began to be sent to the client and once complete, these events are recorded in the log as TCP_MISS.
- The relationship between peer cache or later called itself there are two types, namely parent and sibling. Sibling position parallel to each other sibling, while the parent is on top sibling, these two types of peer which would then be coupled to form a hierarchical network cache
- ICP as a cache protocol plays a role in asking the availability of objects in the cache. In a network having a sibling cache, will try to find the required sibling to another peer, not to the parent, the cache will send a signal to the sibling and sibling ICP responded with the availability of information exists or not. If there is, the cache will register ICP_HIT in logs. After assurance of the bias is taken from the sibling object, then the cache will send a signal to a sibling http to retrieve the object in question. And having got it, the cache will record log SIBLING_HIT.
- If you find that sibling does not provide the sought object, the cache will ask the parent. As a parent, he must find the requested object is although he himself did not have it (TCP_MISS). After the object obtained from the origin server, the cache object will be sent to the last child, after child will get it down as cached PARENT_HIT.
- Configuration, usage and methods of Squid
- Squid basic configurations include:
- http_port port number. This will show the port number that will be used to run the squid. This port number will be used to get in touch with clients and peers.
- icp_port port number. This will show the port number that will be used to run the squid. This port number will be used to get in touch with clients and peers.
- cache_peer nama_peer tipe_peer nomor_port_http nomor_port_icp option. Sintask of peer cache is used to connect to another peer, and other peer connected this type depends on the type of peer that has declared this type of bias-type sibling or parent, and the port used for HTTP and ICP relationship is also declared here, while the for parameter option here there were all kinds one of which is the default, which means he is the only parent who should be contacted (if the parent type) and proxy-only which means that the object is dipata of peer does not have to be stored in local hard drive.
- Dead_peer_timeout jumlah_detik seconds. Each peer who previously have been defined for the specified timeout time in this configuration, if the peer does not answer posts ICP signal within a predetermined time limit, a peer will be deemed to not be able to reach, and the cache server will not retrieve an object from the server concerned within a certain time interval.
- Hierarcy_stoplist pola1 pola2 This syntax is used to state what should not be requested from the peer, but must be directly from the origin web server, if pola1 and pattern 2 is a parameter cgi-bin,?, Etc. then if there is a request URL that contains the character it will be taken directly to the origin server.
- Cache_mem jumlah_memori (in bytes) This syntax will determine the upper limit on the amount of memory used to store, among others: intransit object that is the object that the transitional period between the time of downloading the cache until delivered to the client object, and hot objects, ie objects that are frequently accessed.
- Cache_swap_low / high amount (in percent) Squid will remove objects that exist within hardisknya if the media is beginning to fill. This full size set on the cache_swap_low and cache_swap_high. When the limit has been reached then swap_low squid began to remove and if the limit is reached then the squid swap_high will more often to remove.
- Jenis_file_sistem cache_dir directory kapasitas_cache dir_1 number dir_2 This syntax will explain the cache directory is used, the first is the type of file system, then didirektori where the cache will be stored, then the cache size in megabytes and the number of directories and directory level 1 level 2 for squid to objectnya store.
- ACL (Access Control List)
- Further follow-up squid configurations, other than as a cache server, squid are indeed acting as â € œparentâ €?? to request the object from the client can also be configured for more advanced setting permissions, for the first time in question is an ACL (access control list), the ACL itself consists of several types, among others:
- Src - the IP address from which the client used
- Dst - destination IP address that the client requested
- Myip - local IP address where the client is connected
- srcdomain - domain name from client
- dstdomain - domain name of the client destination
- srcdom_regex-search pattern in a string of domain names from client
- dstdom_regex - Search pattern in a string of domain name client's goals
- Time - Time expressed in days and hours
- Proto - transfer protocol (http, ftp, gopher)
- Method - the http request method (get, post, connect)
- Next is the control list that will be used to adjust the control of the ACL, control list include:
- http_access - allow acess http
- icp_access - allow the peer to send ICP for menquery object
- miss_access - allows a client request object that does not exist (miss) in the cache
- no_cache - client requested object does not need to be saved to disk
- always_direct - request addressed directly to the origin server
- never direct - the request is handled indirectly to the origin server.
- As an example ACL configuration syntax is given as below:
- # The ACL
- ACL localnet src 192.168.100.0/24
- ACL localkomp 127.0.0.1/255.255.255.255
- Isp dst ACL 202.59.206.65/30
- ACL allsrc src 0.0.0.0/0.0.0.0
- ACL alldst dst 0.0.0.0 / 0
- Other ACL src 10.10.11.11/32
- ACL domainku srcdomain. Jatara.net
- # The control list
- http_access deny other
- http_access allow localnet
- http_access allow lokalkomp
- http_access allow domainku
- http_access deny allsrc
- always_direct allow isp
- always_direct deny alldst
- On the concept of squid configuration syntax is that something that has been executed in a more above the line then he is not executed again dibaris the bottom, although the parameters are below the ACL he also includes, for more details, if there is an IP address 192.168.100.0/24 the IP addresses range from 192.168.100.1 â € "192 168 100 254 (localnet ACL) has been allowed to access http indicated by http_access allow localnet, and underneath there is an ACL allsrc that it is covering all of the list of IP addresses and ACLs were not allowed access http, ie http_access_deny allsrc, but because he had been executed localnet ACL to as IP addresses are allowed access, then despite the dibaris bwahnya executed again, it will not take effect, things like that used for a cache server administrator to perform control so that do not be too detailed when setting upper and lower lines equally affect each other.
- Peering
- Back talking about peering configuration. So the squid option or setting parameters for squid many variations, among others, contained in the example below:
- Ugm.ac.id cache_peer sibling 8080 3130 proxy-only
- Itb.ac.id cache_peer parent 3128 3130 no-digest round-robin
- Ui.ac.id cache_peer parent 3128 3139 weight = 2 no-digest
- To adjust these, type either sibling or parent peer, port number for ICP or http connection has been described in the previous chapter, will be discussed here about the options available is a proxy-only, round-robin, and no-digest.
- On the peer cache sibling is defined as a proxy-only which means the whole object obtained from the sibling will not be saved into hardsik, so the object is finished downloading then the object will be directly delivered to the client and the object is removed from memory, the next option is the weight, weight option is used for setting a higher priority value then he is a parent cache which will be contacted first, round-robin option serves to rotate the turn which parent will be asked to find an object, in this case if there are many parent who is not given the option weight to the priority round-robin, this option is used to cycle through the cache to be contacted in turn.
- Medium-digest option is no one alternative is to talk with peer squid. Cache digest using how to collect the header of each object that has been saved into a file. This file which will be forwarded or downloaded by a peer using the http protocol. This header is collected in the compressed version of a high ratio.
- With the cache-digests obtained from the peer, Squid clarify the status of the requested object existence, without the need to ask beforehand via the ICP protocol, clear of the squid can optimize banwitdh here, especially if the peer is located within a distance far enough hoop logic. Cache Digest itself degenerate periodically and depending on the amount of each object, each object is stored in the header of 10 bits.
- Object Cache
- Setting a cache server object is one thing to note here. It has been known in advance that the object is stored in two large cache_dir level level defined in the main configuration squid. The object itself contains the URL requested content client and stored in the form of a binary file, each object has metadata that is part of the contents stored in memory to make it easier to track where the location of the object and what the contents of the object. Many of the properties that need to be observed for the optimization of this squid, among others:
- Age Age obect object is a measure of time spent on an object to remain in the disk cache. Age object is limited by several factors, namely:
- removal method object object can be removed through the algorithm be some elimination:
- sumber: http://opensource.telkomspeedy.com/
Advertisement
Add Comment
Please, Sign In to add comment